ci: pin actions to commit SHAs and add shellcheck#3126
Conversation
Pin actions/github-script in catalog-assign.yml to a full commit SHA; all other workflows were already pinned. Add a repo-wide regression test that every workflow `uses:` ref is pinned to a 40-char commit SHA. Add a shellcheck job to lint.yml (--severity=error over scripts/bash/*.sh) and document the local command in CONTRIBUTING.md.
There was a problem hiding this comment.
Pull request overview
This PR improves CI/workflow supply-chain hygiene by ensuring GitHub Actions are pinned to immutable commit SHAs, adds a regression test to enforce that policy, and introduces a ShellCheck lint job for the repo’s Bash scripts.
Changes:
- Pin
actions/github-scriptincatalog-assign.ymlto a full 40-char commit SHA. - Add
tests/test_github_workflows.pyto assert all workflowuses:references are pinned to commit SHAs. - Add a
shellcheckjob tolint.ymland document the local command inCONTRIBUTING.md.
Show a summary per file
| File | Description |
|---|---|
tests/test_github_workflows.py |
Adds a regression test to enforce SHA-pinned uses: refs across .github/workflows/*.yml(yaml). |
CONTRIBUTING.md |
Documents the local ShellCheck invocation consistent with the new CI job. |
.github/workflows/lint.yml |
Introduces a new ShellCheck job to lint scripts/bash/*.sh in CI. |
.github/workflows/catalog-assign.yml |
Pins actions/github-script to a full commit SHA to reduce supply-chain risk. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 1
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback
|
Addressed the Copilot finding: the |
Assisted-by: Codex (model: GPT-5, autonomous)
Assisted-by: Codex (model: GPT-5, autonomous)
|
Posted on behalf of @PascalThuet by Codex (model: GPT-5). Addressed the review feedback in
Validated with:
|
|
Thank you! |
Part of splitting #2442 into smaller, dedicated PRs (per maintainer request). This is the first, dependency-free slice: workflow hygiene only, no runtime code changes.
What
actions/github-scriptincatalog-assign.ymlto a full commit SHA (3a2844b…# v9). All other workflows were already pinned.tests/test_github_workflows.py: a repo-wide regression test asserting every non-localuses:ref is pinned to a 40-char commit SHA, accepting uppercase or lowercase hex.shellcheckjob tolint.yml(git ls-files -z -- '*.sh' | xargs -0 shellcheck --severity=error) over tracked shell scripts.CONTRIBUTING.mdwith wording that matches what--severity=erroractually reports.Why
Unpinned actions are a supply-chain risk: a moved tag can change the executed code. The shellcheck job catches error-severity bugs in committed bash scripts without expanding this PR into a broader warning cleanup.
Validation
uv sync --extra test.venv/bin/python -m pytest tests/test_github_workflows.py -quvx ruff check tests/test_github_workflows.pygit diff --checkgit ls-files -z -- '*.sh' | xargs -0 shellcheck --severity=errorSplit from #2442. No dependency on the other split PRs.
Disclosure
Prepared by Codex (model: GPT-5) on behalf of @PascalThuet.