Skip to content

Pin GitHub Actions to full-length commit SHAs#47

Merged
data-douser merged 4 commits intomainfrom
copilot/pin-github-actions-to-commit-shas
Apr 23, 2026
Merged

Pin GitHub Actions to full-length commit SHAs#47
data-douser merged 4 commits intomainfrom
copilot/pin-github-actions-to-commit-shas

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

External GitHub Actions in .github/workflows/ and .github/actions/ were referenced by mutable tags (@v6, @main, etc.), leaving CI exposed to upstream tag-rewriting attacks.

Changes

  • Workflows pinned to commit SHAs (with # tag trailing comments):
    • copilot-setup-steps.ymlactions/checkout
    • lint-and-format.ymlactions/checkout, actions/setup-node
    • codeql-qlt-unit-tests.ymlactions/checkout ×3, actions/upload-artifact, actions/download-artifact
  • Composite action setup-codeql-environment/action.yml: pinned actions/cache ×4, actions/setup-node, actions/setup-python ×2, actions/setup-java ×2, actions/setup-go ×2, actions/setup-dotnet, ruby/setup-ruby ×2, and advanced-security/codeql-development-toolkit/.github/actions/install-qlt (was floating on @main).
  • New Copilot instructions at .github/instructions/github_workflows_yaml.instructions.md (applyTo: .github/{actions,workflows}/**/*.{yml,yaml}) codifying SHA-pinning, least-privilege permissions, and lint/format expectations — mirroring the pattern from codeql-development-mcp-server.

Format used throughout:

uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

Not changed (already satisfies acceptance criteria)

  • Workflows already declare least-privilege permissions: contents: read.
  • .github/dependabot.yaml already enables weekly github-actions updates, which will keep the SHAs current.

Notes for reviewers

  • install-qlt is pinned to a recent main SHA with # main as the comment, since the upstream action publishes no semver tag. Bumping cadence will be driven by Dependabot.
  • SHAs were resolved from upstream lightweight tag refs at time of authoring.

Copilot AI changed the title [WIP] Pin GitHub Actions to full-length commit SHAs and apply hardening Pin GitHub Actions to full-length commit SHAs Apr 22, 2026
Copilot AI requested a review from data-douser April 22, 2026 21:43
Upgrades the codeql CLI version from 2.23.5 to 2.25.2 in an attempt
to resolve unit testing failures for bundled CodeQL queries.
@data-douser data-douser marked this pull request as ready for review April 23, 2026 01:21
@data-douser data-douser requested review from a team and enyil as code owners April 23, 2026 01:21
@data-douser data-douser added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit 2e1d6c1 Apr 23, 2026
28 of 29 checks passed
@data-douser data-douser deleted the copilot/pin-github-actions-to-commit-shas branch April 23, 2026 01:22
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.

Pin GitHub Actions to full-length commit SHAs and apply supply chain hardening

2 participants