Skip to content

ci: pin actions to commit SHAs and add shellcheck#3126

Open
PascalThuet wants to merge 3 commits into
github:mainfrom
PascalThuet:split/pin-actions-shellcheck
Open

ci: pin actions to commit SHAs and add shellcheck#3126
PascalThuet wants to merge 3 commits into
github:mainfrom
PascalThuet:split/pin-actions-shellcheck

Conversation

@PascalThuet

Copy link
Copy Markdown
Contributor

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

  • Pin actions/github-script in catalog-assign.yml to a full commit SHA (3a2844b… # v9). All other workflows were already pinned.
  • Add tests/test_github_workflows.py: a repo-wide regression test asserting every uses: ref is pinned to a 40-char commit SHA.
  • Add a shellcheck job to lint.yml (--severity=error over scripts/bash/*.sh).
  • Document the local shellcheck command in CONTRIBUTING.md.

Why

Unpinned actions are a supply-chain risk: a moved tag can change the executed code. The shellcheck job catches real bugs in committed bash scripts.

Validation

  • tests/test_github_workflows.py passes (12 workflows scanned, all pinned).
  • shellcheck --severity=error scripts/bash/*.sh runs in CI.

Split from #2442. No dependency on the other split PRs.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-script in catalog-assign.yml to a full 40-char commit SHA.
  • Add tests/test_github_workflows.py to assert all workflow uses: references are pinned to commit SHAs.
  • Add a shellcheck job to lint.yml and document the local command in CONTRIBUTING.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

Comment thread .github/workflows/lint.yml Outdated

@mnriem mnriem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback

@PascalThuet PascalThuet deleted the split/pin-actions-shellcheck branch June 23, 2026 18:57
@PascalThuet PascalThuet reopened this Jun 23, 2026
@PascalThuet

Copy link
Copy Markdown
Contributor Author

Addressed the Copilot finding: the shellcheck job's actions/checkout is now pinned to the repo-standard 9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 (matching the markdownlint job above it and every other workflow), instead of # v6.0.3. Commit 5d5fb75.

@PascalThuet PascalThuet requested a review from mnriem June 23, 2026 20:43
Assisted-by: Codex (model: GPT-5, autonomous)
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.

3 participants