Visitar URL original
Pin github actions to commit SHAs in all workflows by averevki · Pull Request #2057 · Kuadrant/kuadrant-operator · GitHub
Skip to content

Pin github actions to commit SHAs in all workflows - #2057

Merged
averevki merged 1 commit into
mainfrom
use-hashes-on-github-actions
Jul 2, 2026
Merged

averevki merged 1 commit into
mainfrom
use-hashes-on-github-actions

Conversation

@averevki

@averevki averevki commented Jun 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Pin all GitHub Action references across 16 workflow files to their full commit SHAs using ratchet
  • Use ratchet's # ratchet:action@tag comment format to enable automated SHA updates via ratchet update
  • Add a ratchet-check CI workflow that lints pull requests for unpinned action references
  • Add verify-ratchet and ratchet-pin targets to Makefile for easier management locally

Part of the work on #2055

Motivation

Tags are mutable — action maintainers can force-push them, silently changing the code our CI runs. Pinning to commit SHAs makes each reference immutable, mitigating supply-chain attacks.

The ratchet check workflow prevents regressions by blocking PRs that introduce unpinned references.

Summary by CodeRabbit

  • Chores
    • Enhanced CI/CD security and reproducibility by pinning all GitHub Actions to specific commit hashes instead of floating version tags across automated workflows.

@averevki averevki self-assigned this Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@averevki, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4e9de8f0-4b9a-419c-b238-cd1865890add

📥 Commits

Reviewing files that changed from the base of the PR and between 3ed3606 and a232818.

📒 Files selected for processing (19)
  • .github/workflows/automated-release.yaml
  • .github/workflows/build-images-base.yaml
  • .github/workflows/build-images-for-tag-release.yaml
  • .github/workflows/build-images-nightly.yaml
  • .github/workflows/code-style.yaml
  • .github/workflows/codeql-analysis.yml
  • .github/workflows/delete-release-helm-chart.yaml
  • .github/workflows/issues-workflow.yaml
  • .github/workflows/ratchet-check.yaml
  • .github/workflows/release-helm-chart.yaml
  • .github/workflows/release-operator.yaml
  • .github/workflows/smoke-test.yaml
  • .github/workflows/test-alerts.yaml
  • .github/workflows/test-upgrade.yaml
  • .github/workflows/test.yaml
  • .github/workflows/upload-dashboards.yaml
  • .github/workflows/verify-dashboards-alerts.yaml
  • Makefile
  • make/verify.mk
📝 Walkthrough

Walkthrough

This PR pins GitHub Actions across workflow files to commit SHAs, adds ratchet-based workflow pinning and linting support, and updates workflow formatting in a few places. No workflow triggers, inputs, or command logic change beyond the added ratchet checks.

Changes

GitHub Actions SHA pinning

Layer / File(s) Summary
Ratchet tooling and checks
Makefile, make/verify.mk, .github/workflows/ratchet-check.yaml
Adds ratchet installation, a pinning target, a lint verification target, and a workflow that runs ratchet on workflow-file pull requests.
Release and image workflows pinned
.github/workflows/automated-release.yaml, .github/workflows/release-operator.yaml, .github/workflows/release-helm-chart.yaml, .github/workflows/delete-release-helm-chart.yaml, .github/workflows/issues-workflow.yaml, .github/workflows/build-images-base.yaml, .github/workflows/build-images-for-tag-release.yaml, .github/workflows/build-images-nightly.yaml
Checkout, Go setup, image build/push, release upload, project assignment, and crane setup actions are updated from floating tags to pinned commit SHAs.
Test, code-style, and alert workflows pinned
.github/workflows/test.yaml, .github/workflows/test-alerts.yaml, .github/workflows/test-upgrade.yaml, .github/workflows/smoke-test.yaml, .github/workflows/code-style.yaml, .github/workflows/codeql-analysis.yml, .github/workflows/upload-dashboards.yaml, .github/workflows/verify-dashboards-alerts.yaml
Test, lint, CodeQL, smoke, upgrade, and dashboard workflows pin checkout, Go setup, Codecov, kind, kubectl, skip-duplicate, CodeQL, and related actions, with minor formatting changes in several trigger and job blocks.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • eguzki
  • crstrn13

Poem

🐇 I hop through YAML, neat and bright,
With SHAs pinned firm, no tags in sight.
Ratchet hums a tiny tune,
Keeping workflows tidy as a moon.
Thump! The rabbit gives a gleeful cheer.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: pinning GitHub Actions to commit SHAs across workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch use-hashes-on-github-actions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@averevki averevki moved this to Ready For Review in Kuadrant Jun 22, 2026
@codecov

codecov Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.98%. Comparing base (5519dbf) to head (a232818).
⚠️ Report is 500 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2057      +/-   ##
==========================================
- Coverage   75.08%   74.98%   -0.11%     
==========================================
  Files         127      127              
  Lines       12632    12632              
==========================================
- Hits         9485     9472      -13     
- Misses       2665     2673       +8     
- Partials      482      487       +5     
Flag Coverage Δ
bare-k8s-integration 20.13% <ø> (-0.03%) ⬇️
controllers-integration 53.46% <ø> (-0.07%) ⬇️
envoygateway-integration 40.97% <ø> (+0.24%) ⬆️
gatewayapi-integration 16.09% <ø> (+0.09%) ⬆️
istio-integration 44.63% <ø> (-0.26%) ⬇️
unit 28.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
api (u) 85.88% <ø> (ø)
internal (u) 76.40% <ø> (-0.12%) ⬇️
pkg (u) 39.13% <ø> (ø)
see 10 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (9)
.github/workflows/upload-dashboards.yaml (1)

20-20: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Avoid persisting checkout credentials in this publishing workflow.

Line 20 should set persist-credentials: false; subsequent steps use curl with Grafana credentials and do not require authenticated git writes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/upload-dashboards.yaml at line 20, The actions/checkout
action on line 20 is persisting checkout credentials unnecessarily, creating a
security risk since subsequent steps use curl with Grafana credentials for
publishing and do not require authenticated git writes. Add the parameter
persist-credentials: false to the
actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 action to disable
credential persistence and improve security in this publishing workflow.

Source: Linters/SAST tools

.github/workflows/verify-dashboards-alerts.yaml (1)

23-23: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Set persist-credentials: false for checkout.

Line 23 should not persist the workflow token in local git config for this verification job.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/verify-dashboards-alerts.yaml at line 23, The checkout
action on line 23 is missing the persist-credentials configuration. Add a
`with:` section to the actions/checkout action and set `persist-credentials:
false` to prevent the workflow token from being persisted in the git
configuration for this verification job.

Source: Linters/SAST tools

.github/workflows/test-upgrade.yaml (1)

35-35: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Avoid persisting checkout credentials by default.

Line 35 and Line 145 should set persist-credentials: false unless a later step needs authenticated git operations, which is not evident in this workflow path.

Also applies to: 145-145

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-upgrade.yaml at line 35, Both instances of the
actions/checkout action (at line 35 and line 145) need to explicitly disable
credential persistence for security best practices. Add a with section to each
actions/checkout invocation and set persist-credentials: false within it, unless
subsequent steps in those workflow paths require authenticated git operations.

Source: Linters/SAST tools

.github/workflows/smoke-test.yaml (1)

17-17: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Set persist-credentials: false on checkout usages.

Line 17 (also Lines 34 and 117) persists the token in git config without a clear requirement for authenticated git writes later in the job.

Also applies to: 34-34, 117-117

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/smoke-test.yaml at line 17, The actions/checkout action in
the smoke-test.yaml file persists authentication credentials in the git config
unnecessarily, which poses a security risk. On all three occurrences of the
checkout action (at lines 17, 34, and 117), add a with section that includes
persist-credentials: false. This configuration prevents the GitHub token from
being stored in git config when there is no requirement for authenticated git
operations later in the workflow.

Source: Linters/SAST tools

.github/workflows/codeql-analysis.yml (1)

45-45: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Harden checkout token handling in both jobs.

Line 45 and Line 84 should use persist-credentials: false unless authenticated git operations are intentionally required later.

Also applies to: 84-84

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/codeql-analysis.yml at line 45, The checkout actions at
both locations (the one using
actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 and the second
checkout action mentioned at line 84) do not include the persist-credentials
parameter set to false. Add `persist-credentials: false` as a parameter to both
checkout action invocations in the workflow unless authenticated git operations
are explicitly required later in the respective jobs. This hardens the security
posture by ensuring checkout credentials are not persisted in the git
configuration after the checkout step completes.

Source: Linters/SAST tools

.github/workflows/test-alerts.yaml (2)

23-23: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add persist-credentials: false to checkout steps.

Line 23 (also Lines 39 and 57) should avoid persisting credentials because these jobs do not push commits and still run repo-controlled commands.

Also applies to: 39-39, 57-57

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-alerts.yaml at line 23, The checkout steps using
actions/checkout are persisting credentials unnecessarily since the test-alerts
jobs do not perform any git push operations. Add the parameter
persist-credentials: false to each of the three actions/checkout steps (at lines
23, 39, and 57) to disable credential persistence and improve security by
avoiding storing credentials when they are not needed.

Source: Linters/SAST tools


41-41: 🧹 Nitpick | 🔵 Trivial

Consider hardening cache for defence-in-depth, though built-in protections apply here.

Line 41 uses default cache behaviour (cache enabled). Whilst pull_request events benefit from GitHub's built-in cache scoping that prevents fork PRs from poisoning the base branch, explicitly setting cache: false provides an additional hardening layer if your security policy requires it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-alerts.yaml at line 41, The setup-go action step is
using default cache behavior, which should be explicitly hardened for
defense-in-depth security. Add the parameter `cache: false` to the `uses:
actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c` step to disable
caching and prevent potential cache poisoning attacks from forked pull requests.

Source: Linters/SAST tools

.github/workflows/test.yaml (1)

21-21: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Set persist-credentials: false on checkout steps that do not push.

Line 21 (and the other checkout steps in this file) leaves the workflow token in local git config. These jobs execute repository code (make, scripts), so this increases token exposure surface without a functional need.

Suggested hardening
-      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5  # v4
+      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5  # v4
+        with:
+          persist-credentials: false

Also applies to: 40-40, 83-83, 134-134, 181-181, 237-237, 281-281, 297-297, 320-320, 337-337, 354-354, 371-371, 390-390

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yaml at line 21, The checkout action
(actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5) is leaving the
workflow token in the local git config without a functional need, since these
jobs only execute repository code and do not push. Add the `persist-credentials:
false` parameter to the checkout steps that do not require the token for
pushing. Apply this change to all checkout steps in the workflow file as
indicated in the comment (lines 21, 40, 83, 134, 181, 237, 281, 297, 320, 337,
354, 371, 390).

Source: Linters/SAST tools

.github/workflows/code-style.yaml (1)

46-46: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Disable checkout credential persistence where not needed.

Line 46, Line 96, and Line 273 should set persist-credentials: false to reduce token exposure during style/lint jobs.

Also applies to: 96-96, 273-273

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/code-style.yaml at line 46, The actions/checkout steps at
lines 46, 96, and 273 do not disable credential persistence, which increases
token exposure unnecessarily in style and lint jobs that do not require Git
credentials. Add the `persist-credentials: false` option to each of the three
`actions/checkout` action invocations to reduce the token exposure surface. This
option should be set after the `uses` line for each checkout action reference.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-images-for-tag-release.yaml:
- Line 22: The checkout steps at the
actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 action usages on lines
22, 78, and 135 do not disable credential persistence. Add a with clause to each
of these three checkout steps that sets persist-credentials to false. This
prevents git authentication tokens from being persisted on the runner, reducing
credential exposure since these checkout steps only perform read operations and
do not require git write capabilities.

In @.github/workflows/delete-release-helm-chart.yaml:
- Line 14: In the delete-release-helm-chart.yaml workflow, the actions/checkout
action on line 14 is persisting checkout credentials unnecessarily. Add the
`persist-credentials: false` parameter to the actions/checkout step to disable
credential persistence. This is a security best practice for read-only jobs that
don't perform any git write operations and reduces unnecessary token exposure on
the runner.

In @.github/workflows/smoke-test.yaml:
- Line 37: The `actions/setup-go` action on line 37 lacks explicit cache policy
configuration, which presents a cache poisoning risk in PR workflows. Add a
`with:` section to the setup-go action to explicitly configure cache behavior by
setting `cache: false` to disable caching for PR events, or alternatively
implement conditional logic to disable caching specifically for pull request
events while allowing it for other trusted events like pushes to the main
branch.

In @.github/workflows/test.yaml:
- Line 42: The workflow file has multiple `actions/setup-go` steps with default
caching enabled on lines 42, 85, 136, 183, 239, 283, 299, 322, 339, 356, and
373, which creates a cache-poisoning security risk when the workflow runs on
untrusted pull request events. Add the `cache: false` parameter to each
`actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c` step to explicitly
disable caching and prevent malicious code from poisoning the shared cache that
subsequent privileged workflows would consume.

---

Nitpick comments:
In @.github/workflows/code-style.yaml:
- Line 46: The actions/checkout steps at lines 46, 96, and 273 do not disable
credential persistence, which increases token exposure unnecessarily in style
and lint jobs that do not require Git credentials. Add the `persist-credentials:
false` option to each of the three `actions/checkout` action invocations to
reduce the token exposure surface. This option should be set after the `uses`
line for each checkout action reference.

In @.github/workflows/codeql-analysis.yml:
- Line 45: The checkout actions at both locations (the one using
actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 and the second
checkout action mentioned at line 84) do not include the persist-credentials
parameter set to false. Add `persist-credentials: false` as a parameter to both
checkout action invocations in the workflow unless authenticated git operations
are explicitly required later in the respective jobs. This hardens the security
posture by ensuring checkout credentials are not persisted in the git
configuration after the checkout step completes.

In @.github/workflows/smoke-test.yaml:
- Line 17: The actions/checkout action in the smoke-test.yaml file persists
authentication credentials in the git config unnecessarily, which poses a
security risk. On all three occurrences of the checkout action (at lines 17, 34,
and 117), add a with section that includes persist-credentials: false. This
configuration prevents the GitHub token from being stored in git config when
there is no requirement for authenticated git operations later in the workflow.

In @.github/workflows/test-alerts.yaml:
- Line 23: The checkout steps using actions/checkout are persisting credentials
unnecessarily since the test-alerts jobs do not perform any git push operations.
Add the parameter persist-credentials: false to each of the three
actions/checkout steps (at lines 23, 39, and 57) to disable credential
persistence and improve security by avoiding storing credentials when they are
not needed.
- Line 41: The setup-go action step is using default cache behavior, which
should be explicitly hardened for defense-in-depth security. Add the parameter
`cache: false` to the `uses:
actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c` step to disable
caching and prevent potential cache poisoning attacks from forked pull requests.

In @.github/workflows/test-upgrade.yaml:
- Line 35: Both instances of the actions/checkout action (at line 35 and line
145) need to explicitly disable credential persistence for security best
practices. Add a with section to each actions/checkout invocation and set
persist-credentials: false within it, unless subsequent steps in those workflow
paths require authenticated git operations.

In @.github/workflows/test.yaml:
- Line 21: The checkout action
(actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5) is leaving the
workflow token in the local git config without a functional need, since these
jobs only execute repository code and do not push. Add the `persist-credentials:
false` parameter to the checkout steps that do not require the token for
pushing. Apply this change to all checkout steps in the workflow file as
indicated in the comment (lines 21, 40, 83, 134, 181, 237, 281, 297, 320, 337,
354, 371, 390).

In @.github/workflows/upload-dashboards.yaml:
- Line 20: The actions/checkout action on line 20 is persisting checkout
credentials unnecessarily, creating a security risk since subsequent steps use
curl with Grafana credentials for publishing and do not require authenticated
git writes. Add the parameter persist-credentials: false to the
actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 action to disable
credential persistence and improve security in this publishing workflow.

In @.github/workflows/verify-dashboards-alerts.yaml:
- Line 23: The checkout action on line 23 is missing the persist-credentials
configuration. Add a `with:` section to the actions/checkout action and set
`persist-credentials: false` to prevent the workflow token from being persisted
in the git configuration for this verification job.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 17fa5656-3ac2-43dc-8fd0-83f3e56ec8dc

📥 Commits

Reviewing files that changed from the base of the PR and between 5edef44 and a9ca6ff.

📒 Files selected for processing (16)
  • .github/workflows/automated-release.yaml
  • .github/workflows/build-images-base.yaml
  • .github/workflows/build-images-for-tag-release.yaml
  • .github/workflows/build-images-nightly.yaml
  • .github/workflows/code-style.yaml
  • .github/workflows/codeql-analysis.yml
  • .github/workflows/delete-release-helm-chart.yaml
  • .github/workflows/issues-workflow.yaml
  • .github/workflows/release-helm-chart.yaml
  • .github/workflows/release-operator.yaml
  • .github/workflows/smoke-test.yaml
  • .github/workflows/test-alerts.yaml
  • .github/workflows/test-upgrade.yaml
  • .github/workflows/test.yaml
  • .github/workflows/upload-dashboards.yaml
  • .github/workflows/verify-dashboards-alerts.yaml

Comment thread .github/workflows/smoke-test.yaml Resolved
Comment thread .github/workflows/test.yaml Resolved
@eguzki

eguzki commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

I do not see a benefit on doing this. I might be missing something. The fear is that some action maintainer updates v1 and that would break our pipelines?

@averevki

Copy link
Copy Markdown
Member Author

@eguzki

eguzki commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Asking naively, are mutable tags something we should worry about? I am aware it can be a potential security breach, but how risky can it be?

@averevki

Copy link
Copy Markdown
Member Author

I think we should consider this, if actions we use weren't breached until now, doesn't mean they can't be in the future. This is about using mutable vs immutable references to third-party tools, if anything would get compromised in the different supply chains each of these actions use, malicious code could be executed in Kuadrant's CI, including the images building and publishing workflows.

Ideally, it should be changed it everywhere, but we should at least consider switching to hash references in our most critical workflows.

@eguzki eguzki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

How do you compute the sha? Would it make sense to create claude skill to do it? Or maybe document the manual steps?

@averevki
averevki force-pushed the use-hashes-on-github-actions branch 4 times, most recently from c9aa9d7 to 3ed3606 Compare June 29, 2026 12:37
@averevki

Copy link
Copy Markdown
Member Author

That's a good point, I was updating references manually with Claude for the first time. In my latest changes, I added the ratchet CLI tool to the CI and Makefile to run the checks automatically now

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (6)
.github/workflows/test.yaml (1)

21-21: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Use persist-credentials: false for these test and verify checkouts.

These jobs appear to consume the repository contents only, not push back to Git. Leaving checkout credentials persisted across later make and script steps increases token exposure for little benefit, so tightening each changed checkout step is worthwhile here.

Also applies to: 39-40, 83-83, 134-134, 181-181, 237-237, 281-281, 297-297, 319-320, 337-337, 354-354, 371-371, 390-390

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yaml at line 21, The checkout steps used by the test
and verify jobs still persist Git credentials, which is unnecessary for
read-only repository access. Update each affected actions/checkout invocation in
the workflow to set persist-credentials to false, using the existing checkout
steps as the targets to adjust so later make/script steps cannot reuse the
token.
.github/workflows/smoke-test.yaml (1)

17-19: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Disable credential persistence on these read-only checkouts.

These jobs do not appear to push or fetch via Git, but actions/checkout will otherwise leave the token in the local Git config for later steps. Adding persist-credentials: false narrows that exposure without changing the workflow behaviour.

Suggested hardening
-      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
+      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
+        with:
+          persist-credentials: false
...
-      - name: Check out code
-        uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
+      - name: Check out code
+        uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
+        with:
+          persist-credentials: false
...
       - name: Check out testsuite
         uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # ratchet:actions/checkout@v4
         with:
+          persist-credentials: false
           repository: Kuadrant/testsuite
           ref: main
           path: testsuite

Also applies to: 33-34, 116-121

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/smoke-test.yaml around lines 17 - 19, The workflow
checkout step using actions/checkout should disable credential persistence
because these jobs are read-only and do not need the token left in Git config.
Update each checkout occurrence referenced by the smoke-test workflow, including
the one near skip_check, to set persist-credentials to false so the job behavior
stays the same while reducing credential exposure.
.github/workflows/test-alerts.yaml (1)

23-25: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Drop persisted Git credentials from these checkout steps.

Nothing in the shown jobs appears to need authenticated Git operations, so leaving the default checkout credentials in .git/config only expands the blast radius for later steps. persist-credentials: false is the safer default here.

Also applies to: 38-39, 53-57

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-alerts.yaml around lines 23 - 25, Update the
workflow’s checkout steps to avoid leaving Git credentials in the repo config:
add persist-credentials: false to the actions/checkout uses in the affected
jobs, including the checkout step near skip_check and the other checkout steps
referenced in the comment. Keep the rest of the job logic unchanged and locate
the fixes by the actions/checkout and fkirc/skip-duplicate-actions steps.
.github/workflows/release-helm-chart.yaml (1)

48-65: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Prefer the built-in gh client for these release uploads.

GitHub-hosted runners already ship gh, so keeping svenstaro/upload-release-action here preserves an extra third-party action in the trust chain for functionality the runner already provides. Replacing both steps with a single gh release upload ... --clobber step removes that dependency entirely.

Suggested simplification
-      - name: Upload package to GitHub Release
-        uses: svenstaro/upload-release-action@29e53e917877a24fad85510ded594ab3c9ca12de # ratchet:svenstaro/upload-release-action@v2
-        id: upload-chart
-        with:
-          repo_token: ${{ secrets.GITHUB_TOKEN }}
-          file: kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz
-          asset_name: chart-kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz
-          tag: ${{ env.OPERATOR_TAG }}
-          overwrite: true
-
-      - name: Upload provenance file to GitHub Release
-        uses: svenstaro/upload-release-action@29e53e917877a24fad85510ded594ab3c9ca12de # ratchet:svenstaro/upload-release-action@v2
-        id: upload-prov-file
-        with:
-          repo_token: ${{ secrets.GITHUB_TOKEN }}
-          file: kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz.prov
-          asset_name: chart-kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz.prov
-          tag: ${{ env.OPERATOR_TAG }}
-          overwrite: true
+      - name: Upload release assets
+        id: upload-chart
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          gh release upload "${{ env.OPERATOR_TAG }}" \
+            "kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz#chart-kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz" \
+            "kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz.prov#chart-kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz.prov" \
+            --clobber
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release-helm-chart.yaml around lines 48 - 65, The release
upload steps still use svenstaro/upload-release-action instead of the runner’s
built-in gh client. Update the workflow to replace both Upload package to GitHub
Release and Upload provenance file to GitHub Release with a single gh release
upload invocation that targets env.OPERATOR_TAG and uses --clobber, while
uploading both kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz and its .prov
file as chart-kuadrant-operator assets.

Source: Linters/SAST tools

.github/workflows/release-operator.yaml (1)

36-51: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Prefer gh release create over softprops/action-gh-release.

This job already runs shell steps and GitHub-hosted runners include gh, so this action keeps an extra third-party dependency in a security-sensitive release path without adding much value. Swapping it for gh release create would remove one more mutable dependency from the workflow chain.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release-operator.yaml around lines 36 - 51, The release
creation step in the release workflow still uses softprops/action-gh-release,
which adds an unnecessary third-party dependency in a sensitive path. Update the
create_release job to use the built-in gh CLI with gh release create instead,
preserving the same release metadata from kuadrantOperatorTag, releaseBody,
releaseBranch, prerelease, and KUADRANT_DEV_PAT while removing the action
dependency.

Source: Linters/SAST tools

.github/workflows/test-upgrade.yaml (1)

34-35: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Disable credential persistence on these checkouts.

Both jobs look read-only from a Git perspective, so the default checkout behaviour needlessly leaves a token behind for subsequent shell steps. Setting persist-credentials: false keeps the same checkout semantics with a tighter security posture.

Also applies to: 144-145

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-upgrade.yaml around lines 34 - 35, The checkout steps
in the workflow are leaving Git credentials behind by default; update the “Check
out code” steps to disable credential persistence. Apply persist-credentials:
false on the checkout actions in both jobs so the read-only workflow keeps the
same checkout behavior without exposing a token to later shell steps.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/code-style.yaml:
- Around line 46-49: Harden the GitHub Actions checkout usage in the affected
jobs by disabling credential persistence on the checkout step used by
auto-format and lint, since they do not need authenticated Git operations
afterward. Remove the checkout step entirely from required-checks because that
job never uses the workspace. Update the relevant uses: actions/checkout entries
in the workflow so only the necessary jobs keep checkout, and ensure the
setup-go steps remain unchanged.

In @.github/workflows/ratchet-check.yaml:
- Around line 3-16: The ratchet workflow currently exposes more token access
than needed because it inherits the default GITHUB_TOKEN scope and
`actions/checkout` persists credentials before `sethvargo/ratchet` runs. Update
the `ratchet` job in `ratchet-check.yaml` to add an explicit read-only
`permissions` block and disable credential persistence in the `actions/checkout`
step. Keep the fix localized to the `ratchet` job and its `actions/checkout` /
`sethvargo/ratchet` steps.

In @.github/workflows/upload-dashboards.yaml:
- Around line 20-24: The changed-files step in the workflow is using a
single-commit diff and can miss earlier commits or fail when the parent commit
is unavailable. Update the logic in the Set changed files variable step to
compare the push range from github.event.before to github.sha, and ensure the
checkout/fetch configuration retrieves enough history for that range. Keep the
fix localized to the workflow job that uses actions/checkout and the
changed_files calculation.

In `@Makefile`:
- Around line 344-347: The ratchet install target is using the unversioned
binary instead of the versioned artifact, so the pinned version is not what gets
executed later. Update the Makefile’s ratchet target to follow the same pattern
as golangci-lint: make $(RATCHET_V_BINARY) the actual installed binary in the
go-install-tool call, and keep $(RATCHET) only as the symlink/alias so the
versioned file is the source of truth.

---

Nitpick comments:
In @.github/workflows/release-helm-chart.yaml:
- Around line 48-65: The release upload steps still use
svenstaro/upload-release-action instead of the runner’s built-in gh client.
Update the workflow to replace both Upload package to GitHub Release and Upload
provenance file to GitHub Release with a single gh release upload invocation
that targets env.OPERATOR_TAG and uses --clobber, while uploading both
kuadrant-operator-${{ env.OPERATOR_VERSION }}.tgz and its .prov file as
chart-kuadrant-operator assets.

In @.github/workflows/release-operator.yaml:
- Around line 36-51: The release creation step in the release workflow still
uses softprops/action-gh-release, which adds an unnecessary third-party
dependency in a sensitive path. Update the create_release job to use the
built-in gh CLI with gh release create instead, preserving the same release
metadata from kuadrantOperatorTag, releaseBody, releaseBranch, prerelease, and
KUADRANT_DEV_PAT while removing the action dependency.

In @.github/workflows/smoke-test.yaml:
- Around line 17-19: The workflow checkout step using actions/checkout should
disable credential persistence because these jobs are read-only and do not need
the token left in Git config. Update each checkout occurrence referenced by the
smoke-test workflow, including the one near skip_check, to set
persist-credentials to false so the job behavior stays the same while reducing
credential exposure.

In @.github/workflows/test-alerts.yaml:
- Around line 23-25: Update the workflow’s checkout steps to avoid leaving Git
credentials in the repo config: add persist-credentials: false to the
actions/checkout uses in the affected jobs, including the checkout step near
skip_check and the other checkout steps referenced in the comment. Keep the rest
of the job logic unchanged and locate the fixes by the actions/checkout and
fkirc/skip-duplicate-actions steps.

In @.github/workflows/test-upgrade.yaml:
- Around line 34-35: The checkout steps in the workflow are leaving Git
credentials behind by default; update the “Check out code” steps to disable
credential persistence. Apply persist-credentials: false on the checkout actions
in both jobs so the read-only workflow keeps the same checkout behavior without
exposing a token to later shell steps.

In @.github/workflows/test.yaml:
- Line 21: The checkout steps used by the test and verify jobs still persist Git
credentials, which is unnecessary for read-only repository access. Update each
affected actions/checkout invocation in the workflow to set persist-credentials
to false, using the existing checkout steps as the targets to adjust so later
make/script steps cannot reuse the token.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06b3d5ea-b199-4839-bfd4-1a9f8d253f89

📥 Commits

Reviewing files that changed from the base of the PR and between a9ca6ff and 3ed3606.

📒 Files selected for processing (19)
  • .github/workflows/automated-release.yaml
  • .github/workflows/build-images-base.yaml
  • .github/workflows/build-images-for-tag-release.yaml
  • .github/workflows/build-images-nightly.yaml
  • .github/workflows/code-style.yaml
  • .github/workflows/codeql-analysis.yml
  • .github/workflows/delete-release-helm-chart.yaml
  • .github/workflows/issues-workflow.yaml
  • .github/workflows/ratchet-check.yaml
  • .github/workflows/release-helm-chart.yaml
  • .github/workflows/release-operator.yaml
  • .github/workflows/smoke-test.yaml
  • .github/workflows/test-alerts.yaml
  • .github/workflows/test-upgrade.yaml
  • .github/workflows/test.yaml
  • .github/workflows/upload-dashboards.yaml
  • .github/workflows/verify-dashboards-alerts.yaml
  • Makefile
  • make/verify.mk
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/issues-workflow.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/automated-release.yaml
  • .github/workflows/build-images-nightly.yaml

Comment thread .github/workflows/code-style.yaml Resolved
Comment thread .github/workflows/ratchet-check.yaml Resolved
Comment thread Makefile Resolved
Signed-off-by: averevki <sandyverevkin@gmail.com>
@averevki
averevki added this pull request to the merge queue Jul 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 2, 2026
@averevki
averevki added this pull request to the merge queue Jul 2, 2026
Merged via the queue into main with commit d34730c Jul 2, 2026
45 checks passed
@averevki
averevki deleted the use-hashes-on-github-actions branch July 2, 2026 12:40
@github-project-automation github-project-automation Bot moved this from Ready For Review to Done in Kuadrant Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants