Skip to content

Commit b246fb1

Browse files
fix: quote chmod paths and remove fragile sha256sum pipe in templates (#43)
- Quote $(Pipeline.Workspace) in chmod +x to handle paths with spaces - Replace sha256sum -c ... | grep -q with plain sha256sum -c ... which already exits non-zero on failure, avoiding masked errors without pipefail - Update test assertion to match new checksum pattern Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 89c09fa commit b246fb1

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

templates/1es-base.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ extends:
6767
6868
echo "Verifying checksum..."
6969
cd "$DOWNLOAD_DIR"
70-
sha256sum -c checksums.txt --ignore-missing | grep -q ": OK"
70+
sha256sum -c checksums.txt --ignore-missing
7171
mv ado-aw-linux-x64 ado-aw
7272
chmod +x ado-aw
7373
displayName: "Download agentic pipeline compiler (v{{ compiler_version }})"
@@ -182,7 +182,7 @@ extends:
182182
183183
echo "Verifying checksum..."
184184
cd "$DOWNLOAD_DIR"
185-
sha256sum -c checksums.txt --ignore-missing | grep -q ": OK"
185+
sha256sum -c checksums.txt --ignore-missing
186186
mv ado-aw-linux-x64 ado-aw
187187
chmod +x ado-aw
188188
displayName: "Download agentic pipeline compiler (v{{ compiler_version }})"
@@ -327,13 +327,13 @@ extends:
327327
328328
echo "Verifying checksum..."
329329
cd "$DOWNLOAD_DIR"
330-
sha256sum -c checksums.txt --ignore-missing | grep -q ": OK"
330+
sha256sum -c checksums.txt --ignore-missing
331331
mv ado-aw-linux-x64 ado-aw
332332
chmod +x ado-aw
333333
displayName: "Download agentic pipeline compiler (v{{ compiler_version }})"
334334
335335
- bash: |
336-
chmod +x $(Pipeline.Workspace)/agentic-pipeline-compiler/ado-aw
336+
chmod +x "$(Pipeline.Workspace)/agentic-pipeline-compiler/ado-aw"
337337
echo "##vso[task.prependpath]$(Pipeline.Workspace)/agentic-pipeline-compiler"
338338
displayName: Add agentic compiler to path
339339

templates/base.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
6666
echo "Verifying checksum..."
6767
cd "$DOWNLOAD_DIR"
68-
sha256sum -c checksums.txt --ignore-missing | grep -q ": OK"
68+
sha256sum -c checksums.txt --ignore-missing
6969
mv ado-aw-linux-x64 ado-aw
7070
chmod +x ado-aw
7171
displayName: "Download agentic pipeline compiler (v{{ compiler_version }})"
@@ -185,7 +185,7 @@ jobs:
185185
186186
echo "Verifying checksum..."
187187
cd "$DOWNLOAD_DIR"
188-
sha256sum -c checksums.txt --ignore-missing | grep -q ": OK"
188+
sha256sum -c checksums.txt --ignore-missing
189189
mv awf-linux-x64 awf
190190
chmod +x awf
191191
echo "##vso[task.prependpath]$(Pipeline.Workspace)/awf"
@@ -325,7 +325,7 @@ jobs:
325325
326326
echo "Verifying checksum..."
327327
cd "$DOWNLOAD_DIR"
328-
sha256sum -c checksums.txt --ignore-missing | grep -q ": OK"
328+
sha256sum -c checksums.txt --ignore-missing
329329
mv ado-aw-linux-x64 ado-aw
330330
chmod +x ado-aw
331331
displayName: "Download agentic pipeline compiler (v{{ compiler_version }})"
@@ -346,7 +346,7 @@ jobs:
346346
347347
echo "Verifying checksum..."
348348
cd "$DOWNLOAD_DIR"
349-
sha256sum -c checksums.txt --ignore-missing | grep -q ": OK"
349+
sha256sum -c checksums.txt --ignore-missing
350350
mv awf-linux-x64 awf
351351
chmod +x awf
352352
echo "##vso[task.prependpath]$(Pipeline.Workspace)/awf"
@@ -523,14 +523,14 @@ jobs:
523523
524524
echo "Verifying checksum..."
525525
cd "$DOWNLOAD_DIR"
526-
sha256sum -c checksums.txt --ignore-missing | grep -q ": OK"
526+
sha256sum -c checksums.txt --ignore-missing
527527
mv ado-aw-linux-x64 ado-aw
528528
chmod +x ado-aw
529529
displayName: "Download agentic pipeline compiler (v{{ compiler_version }})"
530530
531531
- bash: |
532532
ls -la "$(Pipeline.Workspace)/agentic-pipeline-compiler"
533-
chmod +x $(Pipeline.Workspace)/agentic-pipeline-compiler/ado-aw
533+
chmod +x "$(Pipeline.Workspace)/agentic-pipeline-compiler/ado-aw"
534534
echo "##vso[task.prependpath]$(Pipeline.Workspace)/agentic-pipeline-compiler"
535535
displayName: Add agentic compiler to path
536536

tests/compiler_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ fn test_compiled_yaml_structure() {
145145
"Template should download the compiler from GitHub Releases"
146146
);
147147
assert!(
148-
template_content.contains("sha256sum -c checksums.txt --ignore-missing | grep -q \": OK\""),
149-
"Template should verify checksum using checksums.txt with grep confirmation"
148+
template_content.contains("sha256sum -c checksums.txt --ignore-missing"),
149+
"Template should verify checksum using checksums.txt"
150150
);
151151

152152
// Verify AWF (Agentic Workflow Firewall) is downloaded from GitHub Releases, not ADO pipeline artifacts

0 commit comments

Comments
 (0)