Repository navigation
ci: pin external actions to commit SHAs and resolve own files at job.workflow_sha - #1063
Merged
Merged
Conversation
…workflow_sha - Pin external actions to SHAs; Renovate keeps them updated - terraform_modules_compliance, docs_spread, test (licenserc) and the charmbuild install use job.workflow_repository/job.workflow_sha instead of main - Leave the integration test and publish internal actions at @main (shared contract, build/plan-integration cannot be pinned safely) - Document pinning and Renovate in the README and changelog Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
javierdelapuente
force-pushed
the
pin-actions-to-shas
branch
from
October 22, 2026 09:22
f90142a to
029f668
Compare
Merged
2 tasks done
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Renovate needs an exception for this repository’s internal actions to preserve their intentional floating references and avoid recurring self-update PRs.
1 open issue
What changed in this PR
This PR improves reproducibility for consumers of operator-workflows by pinning external actions and resolving shared files from the called workflow’s commit.
Changes:
- Pin external actions to commit SHAs and enable Renovate digest updates.
- Resolve shared scripts, configuration, and
charmbuildusingjob.workflow_repositoryandjob.workflow_sha. - Document pinning guidance and the intentional integration/publish exceptions.
| File | Description |
|---|---|
| renovate.json | Enable automated action digest pinning. |
| README.md | Explain consumer pinning and exceptions. |
| docs/changelog.md | Record reproducibility changes. |
| .github/workflows/workflow_simple_test.yaml | Pin checkout and Node.js setup actions. |
| .github/workflows/test.yaml | Pin actions and resolve license configuration at the workflow commit. |
| .github/workflows/terraform_modules_test.yaml | Pin checkout and debugging actions. |
| .github/workflows/terraform_modules_release.yaml | Pin checkout actions. |
| .github/workflows/terraform_modules_compliance.yaml | Resolve the checker using workflow contexts and pin actions. |
| .github/workflows/run_bot_pr_approval.yaml | Use a same-commit local workflow reference. |
| .github/workflows/publish_charm.yaml | Pin external publishing actions. |
| .github/workflows/promote_charm.yaml | Pin checkout. |
| .github/workflows/pr_from_template_files.yaml | Pin checkout. |
| .github/workflows/integration_test.yaml | Pin external actions and install charmbuild at the workflow commit. |
| .github/workflows/integration_test_run.yaml | Pin environment, artifact, and debugging actions. |
| .github/workflows/generate_terraform_docs.yaml | Pin documentation and pull-request actions. |
| .github/workflows/docs.yaml | Pin linting, link-checking, and cache actions. |
| .github/workflows/docs_spread.yaml | Resolve the shared script at the workflow commit and pin actions. |
| .github/workflows/docs_rtd.yaml | Pin checkout. |
| .github/workflows/comment.yaml | Pin artifact-download and scripting actions. |
| .github/workflows/comment_contributing.yaml | Pin checkout and scripting actions. |
| .github/workflows/charmbuild_test.yaml | Pin checkout and Python setup actions. |
| .github/workflows/bot_pr_approval.yaml | Pin the scripting action. |
| .github/workflows/auto_update_charm_libs.yaml | Pin checkout and pull-request actions. |
| .github/workflows/allure_report.yaml | Pin checkout and artifact-download actions. |
Review effort: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Test results for commit 8fc9fddTest coverage for 8fc9fdd Static code analysis report |
Contributor
Test results for commit 8fc9fddTest coverage for 8fc9fdd Static code analysis report |
Contributor
Test results for commit 8fc9fddTest coverage for 8fc9fdd Static code analysis report |
Contributor
Test results for commit 8fc9fddTest coverage for 8fc9fdd Static code analysis report |
Contributor
Test results for commit 8fc9fddTest coverage for 8fc9fdd Static code analysis report |
Contributor
Test results for commit 8fc9fddTest coverage for 8fc9fdd Static code analysis report |
javierdelapuente
marked this pull request as draft
October 22, 2026 13:19
javierdelapuente
marked this pull request as ready for review
October 22, 2026 14:37
alithethird
approved these changes
Oct 23, 2026
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.

Applicable spec: N/A (pinning actions for reproducible builds)
Overview
Pins GitHub Actions references so that a pinned
operator-workflowsversion determines the versions of everything it uses, except the integration test and publish pipeline (see below).Rationale
Callers couldn't pin the workflows reproducibly because they referenced their own files at
@main.job.workflow_repository/job.workflow_sha(replacing the deprecatedcanonical/get-workflow-version-action) let a reusable workflow resolve its own repository at the commit it was called with.Workflow Changes
mainSHA with a# maincomment, and Renovate followsmain:canonical/create-pull-request,canonical/action-tmate,canonical/documentation-style-guide,canonical/charm-logdump-action,charmed-kubernetes/actions-operator,apache/skywalking-eyes/header.terraform_modules_compliance.yaml,docs_spread.yaml,test.yaml(licenserc download): use the workflow's own repository and commit instead ofmain.integration_test.yaml:charmbuildis installed fromjob.workflow_repositoryatjob.workflow_sha.run_bot_pr_approval.yaml: uses the local./workflow reference.renovate.jsonextendshelpers:pinGitHubActionDigests; the README documents pinning, with a Renovate example for consumers.Left at
@mainon purposeThe
internal/*actions of the integration test and publish workflows:plan,build,plan-scan,plan-integration,get-plan,publish.job.workflow_shaand using the local action (verified in CI forplan,plan-scan,get-plan,publish).buildandplan-integration: they run in the project directory, so the checkout could be packed into the charm/rock and would change the rock cache key. GitHub also rejects local actions outside the workspace (../).Validation
actionlint -shellcheck= -pyflakes=: only existing warnings, plus unknownjob.workflow_sha/job.workflow_repository(documented GitHub contexts that actionlint's schema lacks).workflow_test.yamlpasses on this revision. Earlier failures were external flakes (Charmhub duplicate upload, snap download,gh-pagespush race).Checklist
Follow-up: pin
operator-workflowsinplatform-engineering-charm-template(canonical/platform-engineering-charm-template#174).