Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/squad-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,12 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
- name: Install gh-aw extension
# Required so `gh aw --version` succeeds and the compile-gate test in
# test/gh-aw-quality.test.ts is NOT skipped. Without this step the test
# uses `it.skipIf(!ghAwAvailable)` and always skips — which is
# indistinguishable from having no gate at all. See #1732.
# Required so `gh aw --version` succeeds and the compiled-workflow gates in
# test/gh-aw-quality.test.ts can compile squad.md. Those gates FAIL CLOSED:
# if gh aw is absent they hard-fail with this exact install command, rather
# than skipping — a skipped gate is indistinguishable from no gate. This
# includes the shell input security contract gate (#1834) and the compile
# contract (#1732).
run: gh extension install github/gh-aw
env:
GH_TOKEN: ${{ github.token }}
Expand Down
42 changes: 42 additions & 0 deletions test/fixtures/gh-aw-shell-contract/violating.lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Positive-control fixture for the gh-aw shell input security contract gate (#1834).
#
# This is a compiled-shaped GitHub Actions lock fragment whose `run:` blocks each
# violate one anti-pattern from workflows/squad.md §"Shell input security contract".
# It exists so the gate is PROVEN capable of failing, not assumed to be: the gate's
# own test feeds this file through the same extractRunBlocks()/scanRunBlocks() used
# on the real squad.lock.yml and asserts each token is named with its file and line.
#
# RETRO's acceptance bar (issue #1834): "A gate that cannot turn red on a fixture
# containing `run: printf '%s\n' \"${{ github.event.issue.body }}\"` is not a valid
# gate." That exact line is the first block below.
#
# DO NOT install or reference this file as a workflow. It lives under test/fixtures/
# so actionlint and gh-aw never see it; only the gate's unit test reads it.
name: shell-contract-positive-control
on:
issues:
types: [opened]
jobs:
violations:
runs-on: ubuntu-latest
steps:
- name: UNTRUSTED_TEMPLATE_IN_RUN — raw event expression inside run
run: printf '%s\n' "${{ github.event.issue.body }}"
- name: UNTRUSTED_PRINTF_FORMAT — body in printf's format slot
env:
SQUAD_TRIGGER_BODY: ${{ github.event.issue.body }}
run: |
body="${SQUAD_TRIGGER_BODY-}"
printf "$body"
- name: UNTRUSTED_COMMAND_STRING — body built into a command string
env:
SQUAD_TRIGGER_BODY: ${{ github.event.issue.body }}
run: |
eval "$SQUAD_TRIGGER_BODY"
bash -c "handle $SQUAD_TRIGGER_BODY"
- name: UNTRUSTED_AWK_PROGRAM_OR_VAR — body through awk -v and awk program
env:
SQUAD_TRIGGER_BODY: ${{ github.event.issue.body }}
run: |
awk -v body="$SQUAD_TRIGGER_BODY" 'BEGIN { print body }'
awk "/$SQUAD_TRIGGER_BODY/ { print }"
Loading