Skip to content

chore(ci): pin all GitHub Action refs to commit SHAs (API-475) - #6819

Merged
MarioAlexandruDan merged 4 commits into
mainfrom
feat/api-475-pin-action-shas
Aug 4, 2026
Merged

MarioAlexandruDan merged 4 commits into
mainfrom
feat/api-475-pin-action-shas

Conversation

@MarioAlexandruDan

@MarioAlexandruDan MarioAlexandruDan commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

🧭 What and Why

🎟 JIRA Ticket: API-475

Floating action tags like actions/checkout@v7 are mutable: whoever controls the action repository can move the tag and every CI run silently picks up the new code. This PR pins every uses: reference to a full commit SHA, with the concrete release version kept as a trailing comment so Renovate can keep the pins updated.

While auditing, we found that the client workflows under clients/*/.github/workflows/ (which are spread verbatim to the public client repos, where the publish credentials live) had the same problem, so they are pinned here too. That extends the original scope of the ticket, which only counted the 8 automation workflows and the setup composite action.

Two follow-up PRs build on this one:

Changes included:

  • Pinned all action refs in the 8 workflow files under .github/workflows/ and in .github/actions/setup/action.yml. Example: .github/workflows/pr-title.yml line 12 now reads actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1.
  • Pinned all action refs in the client workflows under clients/*/.github/workflows/ (release.yml, issue.yml, do-not-edit-this-repository.yml for each language). This includes the reusable workflow call dart-lang/setup-dart/.github/workflows/publish.yml@v1 in the Dart release workflow, and the release actions holding publish credentials (pypa/gh-action-pypi-publish, NuGet/login).
  • Pinned the same refs in templates/issue.yml and templates/do-not-edit-this-repository.yml. The generator copies these two files into every client's .github/workflows/ at generation time (generators/src/main/java/com/algolia/codegen/utils/Helpers.java line 338), so leaving them unpinned would have reverted the pinned client copies on the next codegen pass.
  • Added the missing version comment on the already pinned rubygems/release-gem SHA so Renovate can manage it (clients/algoliasearch-client-ruby/.github/workflows/release.yml line 27, resolves to v1.1.4).
  • Added helpers:pinGitHubActionDigests to the extends list in renovate.json (line 7) so Renovate keeps the pinned SHAs updated. Neither config:js-app nor our shared renovate-config-algolia preset enables digest pinning today.
  • Extended the github-actions manager file patterns in renovate.json (line 285) with /\.github/actions/.*/action\.ya?ml$/ and /^templates/.*\.ya?ml$/. The previous override only matched workflow files, which silently excluded the setup composite action from Renovate updates. The templates pattern is needed because a digest bump on a client workflow copy would otherwise be reverted by the next codegen pass from the stale template, and Renovate would reopen the same update indefinitely.

Deliberately unchanged:

  • actions/create-github-app-token was already pinned with a version comment (6 places).
  • redsun82/setup-swift@b2b6f77... is a fork pin with no release tags, kept as is (see the commented out swift-actions/setup-swift line above it in .github/actions/setup/action.yml). fix(ci): switch back to upstream swift-actions/setup-swiftΒ #6822 moves it back to the upstream action.
  • Local action refs (./.github/actions/setup, ./scripts/ci/actions/restore-artifacts) do not need pinning.

Every floating tag was resolved to the exact commit it points to today, so runtime behavior is identical. Full mapping:

Action Old ref Pinned SHA Version
actions/checkout v7 3d3c42e5aac5ba805825da76410c181273ba90b1 v7.0.1
actions/github-script v9 3a2844b7e9c422d3c10d287c895573f7108da1b3 v9.0.0
actions/cache v6 55cc8345863c7cc4c66a329aec7e433d2d1c52a9 v6.1.0
actions/upload-artifact v7 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a v7.0.1
actions/setup-java v5 b6effb05e454b25005698d916606bdc6ffcbf961 v5.7.0
actions/setup-python v6 ece7cb06caefa5fff74198d8649806c4678c61a1 v6.3.0
actions/setup-node v6 249970729cb0ef3589644e2896645e5dc5ba9c38 v6.5.0
actions/setup-go v6 924ae3a1cded613372ab5595356fb5720e22ba16 v6.5.0
actions/setup-dotnet v5 26b0ec14cb23fa6904739307f278c14f94c95bf1 v5.4.0
dart-lang/setup-dart (action + reusable workflow) v1 65eb853c7ba17dde3be364c3d2858773e7144260 v1.7.2
slackapi/slack-github-action v3.0.3 45a88b9581bfab2566dc881e2cd66d334e621e2c v3.0.3
ruby/setup-ruby v1 (branch) 95ef2b042f9d7a56d8268cba8559e2842e2ad01b v1.321.0
marocchino/sticky-pull-request-comment v3 (branch) 5770ad5eb8f42dd2c4f34da00c94c5381e49af88 v3.0.5
gradle/actions/setup-gradle v6.2.0 3f131e8634966bd73d06cc69884922b02e6faf92 v6.2.0
shivammathur/setup-php v2 f3e473d116dcccaddc5834248c87452386958240 2.37.2
sbt/setup-sbt v1 bfea3c5f48abd221b04a6df4798aa5eb8b6a2baf v1.5.6
Slashgear/action-check-pr-title v5.0.1 161cede0311ec624ae3ee76a2c27522f7b6fa2d8 v5.0.1
pypa/gh-action-pypi-publish release/v1 (branch) dc37677b2e1c63e2034f94d8a5b11f265b73ba33 v1.14.2
nwtgck/actions-netlify v4.0 d22a32a27c918fe470bbc562e984f80ec48c2668 v4.0.0
NuGet/login v1 8d196754b4036150537f80ac539e15c2f1028841 v1.2.0
bodinsamuel/renovate-automatic-branch v1.0.13 8a2f5201c591e669091cea33195ad108dbcf34a1 v1.0.13
rubygems/release-gem already pinned e9a6361a0b14562539327c2a02373edc56dd3169 v1.1.4 (comment added)

Note: ruby/setup-ruby@v1, marocchino/sticky-pull-request-comment@v3 and pypa/gh-action-pypi-publish@release/v1 were floating branches, not tags. Their pinned SHAs are the branch heads, which match the release tags shown in the table.

πŸ§ͺ Test

  • actionlint passes on all touched workflows. The only findings are pre-existing shellcheck notes in run: scripts that this PR does not touch.
  • zizmor reports zero unpinned-uses findings across .github/ and clients/*/.github/workflows/ after this change.
  • renovate.json validated with python3 -m json.tool.
  • Spot verified pins against the GitHub API: actions/checkout@3d3c42e... is the "prep v7.0.1 release (chore(deps): update dependency lerna to v8.0.2Β #2531)" commit, and the ruby/setup-ruby SHA exists in that repo.
  • Every SHA was resolved directly from the upstream repo refs via git ls-remote (annotated tags dereferenced via ^{}), so each pin is the exact commit the old floating ref resolved to at the time of this PR, meaning no behavior change.
  • CI on this PR exercises check.yml and pr-title.yml directly. The scheduled and client release workflows only run later on their own triggers, which is why every SHA was verified against upstream as described above.

@algolia-api-clients-automation-bot

algolia-api-clients-automation-bot Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

No code generated

If you believe code should've been generated, please, report the issue.

πŸ“Š Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
javascript 2270
go 1890
php 1869
csharp 1434
python 1346
java 1313
swift 1138
ruby 956
scala 23

The generator copies templates/issue.yml and
templates/do-not-edit-this-repository.yml into every client's
.github/workflows/ on each generation run, so leaving them unpinned
would revert the pinned client copies at the next codegen pass.
Without this, a digest bump on a client workflow copy would be
reverted by the next codegen pass because the source template kept
the old SHA, and Renovate would reopen the same update.
@MarioAlexandruDan
MarioAlexandruDan merged commit 3bee6d1 into main Aug 4, 2026
35 checks passed
@MarioAlexandruDan
MarioAlexandruDan deleted the feat/api-475-pin-action-shas branch August 4, 2026 14:42
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.

2 participants