Repository navigation
ci: lint every workflow and action, each with the credentials it is allowed - #205
Merged
Merged
Conversation
…llowed `deps` ran lint-workflow.sh over a hand-written list: deploy.yml, release.yml, release-plz.yml and two actions. ci.yml, contract-cell.yml, e2e-schedule.yml, flake-hunt.yml and setup-rust were never linted, and a new workflow would not have been either. - .github/scripts/lint-all-workflows.sh finds every workflow (.github/workflows/*.yml and *.yaml) and every composite action by directory, and lints each. - Each workflow is linted with the jobs that may hold secrets, an environment, or id-token: write: - deploy.yml: its two gated jobs, and `build` for id-token; - release.yml: no secrets, `build` for id-token; - release-plz.yml: the release App's two jobs. - A workflow it does not name gets none of the three. release.yml was linted before with the deploy's defaults; it is now held to what it actually needs. - An empty SECRET_JOBS reads as lint-workflow.sh's default (the deploy's jobs), so "no job" is passed as `-`, which cannot be a job id. - All seven workflows and three actions are clean as they are. - ci.yml: `deps` runs the wrapper in place of its two lint lines; ci-scripts runs the new test. - plan-ci.py treats the wrapper as a `deps` guard. - cicd.md: what the lint covers. Tests: - test-lint-all-workflows.sh, 126 checks. Every workflow name (the three named, ci.yml, a new one) x every credential (none, secrets, environment, id-token) x every job name (deploy, deploy-do, build, release, release-pr, other), against the policy written out again in the test; a refusal must come from R7. Also: a .yaml workflow, an action with an unpinned uses, one bad file before and after a clean one, no workflow at all (exit 2), and this repository with every file counted. - 9 hand mutants of the wrapper, each caught. - Every ci-scripts test and deps guard under dash: 37/37. Refs: #49 Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # docs/src/architecture/cicd.md
# Conflicts: # docs/src/architecture/cicd.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The third of the review's smaller CI fixes (
.agents/plans/cicd-review/PLAN.md): lint every workflow and action, not a hand-written list of them.Before
depsranlint-workflow.shover five files:deploy.yml,release.yml,release-plz.ymland two actions. These were never linted, and a new workflow wouldn't have been either:ci.ymlcontract-cell.ymle2e-schedule.ymlflake-hunt.ymlsetup-rustAfter
.github/scripts/lint-all-workflows.shfinds every workflow (*.ymland*.yaml) and every composite action by directory. It lints each workflow with the jobs that may hold secrets, an environment orid-token: write:secrets.andenvironment:id-token: writedeploy.ymldeploy,deploy-dobuildrelease.ymlbuildrelease-plz.ymlrelease,release-prrelease.ymlis now held to what it needs. Before, it was linted with the deploy's defaults.lint-workflow.shreads an empty value as its own default (the deploy's jobs), so the wrapper passes-, which can't be a job id.ci.yml:depsruns the wrapper in place of its two lint lines.ci-scriptsruns the new test.plan-ci.pytreats the wrapper as adepsguard.cicd.mddescribes the new coverage.Tests
test-lint-all-workflows.sh, 126 checks:.yamlworkflow.uses.ci-scriptstest anddepsguard under dash: 37/37. My local runner now also flags any test file thatci.ymldoesn't run; there are none.Overlap with #202 and #204
All three edit the same "still open" paragraph of
cicd.md, so whichever merges later will need main merged in, which I'll do.Refs: #49
🤖 Generated with Claude Code