Skip to content

ci: pin all tagged actions to commit SHAs and drop two release-workflow actions - #1338

Merged
mbevc1 merged 5 commits into
mainfrom
20261105_chore_gha_pinning
Nov 5, 2026
Merged

mbevc1 merged 5 commits into
mainfrom
20261105_chore_gha_pinning

Conversation

@mbevc1

@mbevc1 mbevc1 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Pin every action that has version tags to the commit its current ref resolves to, so no workflow picks up a moved tag or branch next to secrets or write tokens. kosli-dev/reusable-actions stays on @main because it has no tags for Dependabot to follow. Also drop dawidd6/action-get-tag and dcarbone/install-jq-action from the release workflow, since a run step and the runner's own jq do the same job.

Checklist

@claude

claude Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @mbevc1's task in 2m 0s —— View job


Review of PR #1338: pin mutable action refs

  • Read the PR diff
  • Ran static checks: go build, go vet and the go mod tidy diff are all clean. No Go code changed.
  • Checked the two release.yml replacements (tag step and jq)
  • Posted review

Overall: This looks good. Each pin has a trailing version comment, and removing the two release actions is safe. Two follow-ups below.

Looks good

  • The new Get tag step (release.yml L40–47) behaves the same as before for this workflow, since it only triggers on push: tags. The GITHUB_REF_TYPE check gives a clear error if it's ever triggered another way. It's written safely too: it reads the ref through env vars rather than inline ${{ }}, so nothing gets injected into the script.
  • Removing install-jq-action is safe: the goreleaser job runs on ubuntu-latest, which has jq preinstalled, and the jq calls at L211–229 only use basic features.
  • Pinning kosli-dev/reusable-actions with a # main comment is the honest label for a repo with no tags.
  • Small, separate follow-up: first-party actions (actions/checkout, setup-go, upload-artifact) are still on major tags in release.yml. That's a reasonable line to draw for this PR. If you'd like Dependabot to keep all these SHA pins current, a github-actions ecosystem entry in .github/dependabot.yml would handle that.

Note: this PR only changes .github/workflows/, so I left review comments and didn't commit anything. The App's permissions don't allow edits to workflow files.

Comment thread .github/workflows/docker.yml Resolved
@mbevc1
mbevc1 marked this pull request as ready for review November 5, 2026 23:02
@mbevc1 mbevc1 changed the title ci: pin mutable action refs and drop two release-workflow actions ci: pin all tagged actions to commit SHAs and drop two release-workflow actions Nov 5, 2026
snyk/actions/setup@master, kosli-dev/reusable-actions@main and
anchore/sbom-action@v0 resolve to whatever the branch or floating tag
points at when the job starts, and they run next to SNYK_TOKEN, Slack
webhooks and the release job's contents/id-token/attestations write
permissions. The release job's goreleaser-action and setup-node were
also on floating major tags.

Each ref is pinned to the commit it resolves to today, so behaviour is
unchanged: snyk setup/ is identical between v1.0.0 and master, and
anchore's v0 tag points at v0.24.0. The version comments let Dependabot
keep the tagged pins current. reusable-actions has no tags, so its pin
carries the branch name instead.
dawidd6/action-get-tag only read the tag name from GITHUB_REF; a run
step now does the same from GITHUB_REF_NAME and keeps the step id, so
every steps.tag.outputs.tag reference is unchanged. It also fails on a
non-tag ref, as the action did.

dcarbone/install-jq-action installed jq, which ubuntu-latest runner
images already ship. It ran in the goreleaser job, which holds contents,
id-token and attestations write permissions.
These ran on floating major tags in jobs that hold write tokens and
secrets, including the goreleaser job with contents and id-token write,
GORELEASER_KEY and FURY_TOKEN. Every use is pinned, so the same action
is not mixed pinned and floating across workflows.

Each pin is the commit its major tag points at today (checkout v7.0.1,
setup-go v7.0.0, setup-cli-action v5.2.4), so behaviour is unchanged.
reusable-actions has no version tags, and Dependabot only moves a SHA
pin when the action's repository has at least one tag, so the pin would
go stale. It is our own repository, so following main keeps fixes
flowing to every workflow without a manual bump.
The rest of the third-party and first-party actions still resolved
their tag at job start. Most run next to secrets or write tokens: AWS
OIDC credentials, registry pushes, attestations, the codecov token,
the GitHub App token in the Helm workflow, and the cross-repo PATs that
peter-evans/repository-dispatch receives in the release workflow.

Each pin is the commit its tag points at today, labelled with the most
specific version tag at that commit, so behaviour is unchanged and
Dependabot can keep the pins current. kosli-dev/reusable-actions is the
only action left on a branch, as its repository has no tags.
@mbevc1
mbevc1 force-pushed the 20261105_chore_gha_pinning branch from 7ee5ae9 to cdab328 Compare November 5, 2026 23:11
@mbevc1
mbevc1 enabled auto-merge (squash) November 5, 2026 23:12
@mbevc1
mbevc1 force-pushed the 20261105_chore_gha_pinning branch from a3eda55 to cdab328 Compare November 5, 2026 23:37
@mbevc1
mbevc1 merged commit 8fa199d into main Nov 5, 2026
68 checks passed
@mbevc1
mbevc1 deleted the 20261105_chore_gha_pinning branch November 5, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants