|
| 1 | +# GitHub Actions Pinning Policy |
| 2 | + |
| 3 | +Status: accepted policy decision. |
| 4 | +Scope: GitHub Actions workflow references for this repository. |
| 5 | +Current phase: policy decision only; no workflow action references are changed here. |
| 6 | + |
| 7 | +## Decision |
| 8 | + |
| 9 | +agent-rules-kit accepts full-length commit SHA pinning as the stricter long-term supply-chain policy for GitHub Actions. |
| 10 | + |
| 11 | +The implementation is intentionally separated from this documentation phase. Action references must not be converted by string replacement or broad automation. Each action must preserve its full repository path, including sub-actions such as github/codeql-action/init and github/codeql-action/analyze. |
| 12 | + |
| 13 | +## Why this policy exists |
| 14 | + |
| 15 | +GitHub's security guidance states that pinning an action to a full-length commit SHA is currently the only way to use an action as an immutable release. |
| 16 | + |
| 17 | +The same guidance also notes that tag-based references are more convenient and common, but tags can move or be deleted if an action repository is compromised. |
| 18 | + |
| 19 | +This project currently uses explicit version tags for trusted actions. That is acceptable as a transitional state, not as the final strictest policy. |
| 20 | + |
| 21 | +## Required implementation rules |
| 22 | + |
| 23 | +A future implementation phase must: |
| 24 | + |
| 25 | +- use a dedicated branch; |
| 26 | +- update only workflow action references and the local audit inventory needed to verify them; |
| 27 | +- verify each SHA belongs to the canonical action repository, not a fork; |
| 28 | +- preserve sub-action paths exactly; |
| 29 | +- keep workflow permissions minimal; |
| 30 | +- run local checks before stage; |
| 31 | +- stage exact files only; |
| 32 | +- run a strong pre-push before push; |
| 33 | +- verify PR checks and main checks by exact SHA; |
| 34 | +- document the update path for future Dependabot or manual refreshes. |
| 35 | + |
| 36 | +## Prohibited implementation shortcuts |
| 37 | + |
| 38 | +Do not: |
| 39 | + |
| 40 | +- rewrite action references with blind regex replacement; |
| 41 | +- collapse sub-actions such as github/codeql-action/init into github/codeql-action; |
| 42 | +- invent SHAs; |
| 43 | +- copy SHAs from unofficial sources; |
| 44 | +- combine pinning with release, PyPI, README final, dependency changes, branch protection, Scorecard, CodeQL, or product behavior; |
| 45 | +- describe SHA pinning as a security guarantee. |
| 46 | + |
| 47 | +## Current workflow references |
| 48 | + |
| 49 | +Current transitional references: |
| 50 | + |
| 51 | +- actions/checkout@v7 |
| 52 | +- actions/setup-python@v6 |
| 53 | +- github/codeql-action/init@v4 |
| 54 | +- github/codeql-action/analyze@v4 |
| 55 | +- actions/upload-artifact@v4 |
| 56 | +- actions/download-artifact@v8 |
| 57 | +- pypa/gh-action-pypi-publish@release/v1 |
| 58 | + |
| 59 | +## Release-train impact |
| 60 | + |
| 61 | +For v0.4.0, this policy closes the decision gap. |
| 62 | + |
| 63 | +The actual conversion to full-length SHA pinning remains a separate supply-chain implementation phase and must not be rushed into a release branch without exact repository/SHA verification and a clean Always-Green run. |
0 commit comments