Skip to content

Commit b6e699f

Browse files
Crash0v3rrid3claude
andcommitted
ci: address review on checksum workflow — pin checkout, guard empty glob, quiet output (DEVA11Y-475)
Resolves the three review comments on the verify-selfupdate-checksums workflow: - F-3: pin actions/checkout to a full SHA (v4.2.2) to match the repo's Semgrep.yml convention and close the action-injection surface. - F-2: guard against an empty scripts/**/*.sh glob (would otherwise pass silently); error and exit 1 if no scripts are found. - F-1: redirect sha256sum -c stdout to /dev/null and emit a ::notice:: on success, so GitHub annotations are the sole pass/fail channel. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 796017a commit b6e699f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/verify-selfupdate-checksums.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
verify-sidecars:
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828

2929
- name: Verify scripts and .sha256 sidecars are in sync
3030
run: |
@@ -33,7 +33,12 @@ jobs:
3333
status=0
3434
3535
# 1. Every self-updating script must have a sidecar.
36-
for script in scripts/**/*.sh; do
36+
script_files=(scripts/**/*.sh)
37+
if [ ${#script_files[@]} -eq 0 ]; then
38+
echo "::error::No .sh scripts found under scripts/ — checkout or glob is wrong."
39+
exit 1
40+
fi
41+
for script in "${script_files[@]}"; do
3742
if [ ! -f "${script}.sha256" ]; then
3843
echo "::error file=${script}::Missing checksum sidecar ${script}.sha256. Generate it from the script's directory: shasum -a 256 <name>.sh | awk '{print \$1\" <name>.sh\"}' > <name>.sh.sha256"
3944
status=1
@@ -55,8 +60,8 @@ jobs:
5560
continue
5661
fi
5762
# Sidecars store "<sha256> <basename>", so verify from the script's dir.
58-
if ( cd "$dir" && sha256sum -c "$(basename "$sidecar")" ); then
59-
echo "OK: $sidecar"
63+
if ( cd "$dir" && sha256sum -c "$(basename "$sidecar")" > /dev/null ); then
64+
echo "::notice file=${script}::Checksum OK"
6065
else
6166
echo "::error file=${script}::Checksum mismatch — regenerate ${sidecar} after editing ${script} (run from ${dir}): shasum -a 256 <name>.sh | awk '{print \$1\" <name>.sh\"}' > <name>.sh.sha256"
6267
status=1

0 commit comments

Comments
 (0)