Skip to content

CI: drop persisted checkout credentials, guard with a YAML-parsed test - #2333

Closed
remigiusz-antczak wants to merge 1 commit into
mainfrom
ci/persist-credentials-3
Closed

remigiusz-antczak wants to merge 1 commit into
mainfrom
ci/persist-credentials-3

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Supersedes #2332.

Sets persist-credentials: false on every actions/checkout step in ci.yml and release.yml (zizmor artipacked), and adds scripts/test_workflow_persist_credentials.py, which fails CI if a workflow checkout keeps saved git credentials.

Changes since #2332:

  • The guard now parses each workflow with yaml.safe_load and checks every jobs.*.steps checkout. The line-by-line scanner it replaces still let flow-style steps, quoted keys, uppercase Actions/Checkout, and with: text inside run: pass by mistake.
  • It fails closed (exit 2) when PyYAML is missing or no workflow files are found.
  • It no longer honors ignore comments; all six checkouts comply.

Follow-up: the shipped dcr-gates.yml template checkout (needs a .claude/skills regen).

Local: the new test passes its self-checks. scripts/test-ci-gates.sh passed 303 of 311, with 2 skipped. The 8 failures are the size budget, which fails on base too, and 7 sandbox serial-gate lock cases. CI will also confirm whether the runner's python3 ships PyYAML.

🤖 Generated with Claude Code

Every actions/checkout step in ci.yml and release.yml sets persist-credentials: false. The guard test now parses each workflow with yaml.safe_load instead of scanning text, so quoting, flow style, key case and run:/comment text cannot make it false-pass. The ignore-comment exemption is gone. It exits 2 when PyYAML, the directory or the workflow files are missing.

Tests: 303/311 (scripts/test-ci-gates.sh; 8 fail from the sandbox serial_gate lock and a size budget already over on the base, none in files touched here)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@remigiusz-antczak

Copy link
Copy Markdown
Collaborator Author

Superseded by #2334.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant