Fix Gitleaks PR scan workflow after action token requirement change - #19
Conversation
|
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the CI workflow’s Gitleaks secret scan job configuration to address a failing GitHub Actions run by changing how the gitleaks/gitleaks-action@v2 step is invoked and reducing GitHub token permissions/commenting behavior.
Changes:
- Adds an explicit, restricted
permissions:block for thegitleaks-scanjob. - Sets
GITLEAKS_ENABLE_COMMENTS: falseand providesGITHUB_TOKENto the Gitleaks action viaenv. - Removes the previously configured explicit Gitleaks CLI
args(including--redactand--verbose).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Run Gitleaks | ||
| uses: gitleaks/gitleaks-action@v2 | ||
| with: | ||
| args: detect --source . --verbose --redact | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITLEAKS_ENABLE_COMMENTS: false |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e64dfacee0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -67,5 +70,6 @@ jobs: | |||
|
|
|||
| - name: Run Gitleaks | |||
| uses: gitleaks/gitleaks-action@v2 | |||
There was a problem hiding this comment.
Upgrade the Gitleaks action runtime
On GitHub-hosted ubuntu-latest runs after June 2, 2026, this step still invokes gitleaks-action@v2; the upstream action README says v2 uses Node 20 and will fail unless ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true is set, and this workflow does not set that opt-out. As a result, the Gitleaks job can remain broken before it reaches the token/comment changes; upgrade to gitleaks-action@v3 instead of keeping v2 here.
Useful? React with 👍 / 👎.



The
Gitleaks secret scanGitHub Actions job was failing before any scan ran becausegitleaks/gitleaks-action@v2now requiresGITHUB_TOKENonpull_requestevents. The workflow also passed an unsupportedargsinput that was ignored at runtime.Workflow fix
GITHUB_TOKENto the gitleaks step viaenvCleanup
with.argsentry that the action does not acceptResult