From fea69de299dd12f183c28c1c3ae38b14a1c00118 Mon Sep 17 00:00:00 2001 From: jparker2006 <85816763+jparker2006@users.noreply.github.com> Date: Mon, 23 Nov 2026 02:49:48 +0000 Subject: [PATCH 1/2] #2634: red: the workflow proof must refuse a commented continue-on-error and a job-level defaults shell --- ci/test-comment-check.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ci/test-comment-check.sh b/ci/test-comment-check.sh index e94f8fb..5f40fba 100644 --- a/ci/test-comment-check.sh +++ b/ci/test-comment-check.sh @@ -37,6 +37,10 @@ tolerant=$tmp/tolerant.yml with_step_setting 'continue-on-error: true' "$tolerant" other_shell=$tmp/other-shell.yml with_step_setting 'shell: bash {0}' "$other_shell" +commented=$tmp/commented.yml +with_step_setting 'continue-on-error: true # continue-on-error: false' "$commented" +job_defaults=$tmp/job-defaults.yml +awk '{ print } /^ checks: *$/ { print " defaults: {run: {shell: '"'"'bash {0}'"'"'}}" }' "$workflow" > "$job_defaults" workflow_step() { origin="$tmp/$1" wf=$2 @@ -94,6 +98,10 @@ workflow_step disallowed "$tolerant" expect 'catches: the workflow proof passes a comment-check step that tolerates its own failure' tolerated 'continue-on-error: true' workflow_step disallowed "$other_shell" expect 'catches: the workflow proof passes a comment-check step run in a shell that ignores a failing command' tolerated 'shell: bash {0}' +workflow_step disallowed "$commented" +expect 'catches: the workflow proof reads a trailing comment as the value of continue-on-error' tolerated 'continue-on-error: true # continue-on-error: false' +workflow_step disallowed "$job_defaults" +expect 'catches: the workflow proof misses a job-level flow-style defaults shell' tolerated "defaults: {run: {shell: 'bash {0}'}}" pull_request_ci escaped catalog/x/check.sh '# comment-ok: the runner reads this line' expect 'catches: a reasoned escape tag still fails CI' 0 '' From e28a3234f73a2c883f597315c14613e5857d2df4 Mon Sep 17 00:00:00 2001 From: jparker2006 <85816763+jparker2006@users.noreply.github.com> Date: Mon, 23 Nov 2026 02:50:07 +0000 Subject: [PATCH 2/2] #2634: green: the workflow proof refuses a commented continue-on-error and any defaults or shell key --- ci/test-comment-check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test-comment-check.sh b/ci/test-comment-check.sh index 5f40fba..7244646 100644 --- a/ci/test-comment-check.sh +++ b/ci/test-comment-check.sh @@ -46,7 +46,7 @@ workflow_step() { origin="$tmp/$1" wf=$2 repo="$tmp/$1-$(basename "$wf" .yml)-checkout" git clone -q --depth 1 --no-tags "file://$origin" "$repo" - tolerates=$(grep -n -E "^ *[\"']?(continue-on-error|shell)[\"']? *:" "$wf" | grep -v -E 'continue-on-error: *false *$' || true) + tolerates=$(grep -n -E "(^|[{,[:space:]])[\"']?(continue-on-error|shell|defaults)[\"']? *:" "$wf" | grep -v -E '^[0-9]+: *continue-on-error: *false *$' || true) step_if=$(awk ' /^ *- name: comment-check *$/ { s = 1; ind = index($0, "-"); next } s && /^ *- / && index($0, "-") <= ind { exit } @@ -64,7 +64,7 @@ workflow_step() { cp "$root/tools/comment-check/check.py" tools/comment-check/ set +e if [ -n "$tolerates" ]; then - out="$wf sets what tolerates a failing comment-check, or runs it in another shell than the bash -e this proof models: $tolerates" + out="$wf sets what tolerates a failing comment-check, may run it in another shell than the bash -e this proof models, or writes such a key in a form this proof does not read (only a bare continue-on-error: false passes): $tolerates" code=tolerated elif [ "$step_if" != "github.event_name == 'pull_request'" ] || [ -z "$step_run" ]; then out="no comment-check step that runs on pull requests in $wf (if: '$step_if')"