Skip to content

Commit e812f2a

Browse files
Shawclaude
andcommitted
fix(ci): release.yaml duplicate permissions + gitleaks OSS binary
- release.yaml had two `permissions:` blocks on the `release` job which made GitHub Actions reject the workflow file entirely (failure at parse time, 0s). Merged into a single block with the union of both sets (contents/id-token/ packages/issues/actions). - gitleaks workflow used gitleaks/gitleaks-action@v2 which now requires a paid GITLEAKS_LICENSE for org repos. Replaced with a direct binary install (v8.21.2) + SARIF artifact upload. Same .gitleaks.toml + same fail-on-finding behavior, no license required. Both validated with `actionlint`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7cab7c5 commit e812f2a

2 files changed

Lines changed: 37 additions & 16 deletions

File tree

.github/workflows/gitleaks.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,38 @@ jobs:
2525
# Full history so gitleaks can scan the diff range on PRs.
2626
fetch-depth: 0
2727

28+
- name: Install gitleaks (OSS binary — no license required)
29+
# gitleaks/gitleaks-action@v2 requires a paid license for org repos.
30+
# We download the OSS CLI directly so the scan remains free and
31+
# honors our .gitleaks.toml allowlist + custom rules.
32+
run: |
33+
set -euo pipefail
34+
GITLEAKS_VERSION=8.21.2
35+
curl -sSL -o /tmp/gitleaks.tar.gz \
36+
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
37+
tar -xzf /tmp/gitleaks.tar.gz -C /tmp gitleaks
38+
sudo install -m 0755 /tmp/gitleaks /usr/local/bin/gitleaks
39+
gitleaks version
40+
2841
- name: Run gitleaks
29-
# gitleaks/gitleaks-action@v2
30-
uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7
31-
env:
32-
# No license — uses default OSS scanning. Set GITLEAKS_LICENSE if/when
33-
# an org license is provisioned for richer scans.
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
GITLEAKS_CONFIG: .gitleaks.toml
36-
GITLEAKS_ENABLE_COMMENTS: "false"
37-
GITLEAKS_ENABLE_UPLOAD_ARTIFACT: "true"
38-
GITLEAKS_ENABLE_SUMMARY: "true"
42+
# Scan the full working tree. Returns non-zero on any finding so the
43+
# job fails the build the same way the wrapper action did.
44+
run: |
45+
gitleaks detect \
46+
--config .gitleaks.toml \
47+
--source . \
48+
--verbose \
49+
--redact \
50+
--report-format sarif \
51+
--report-path gitleaks.sarif \
52+
--no-banner
53+
54+
- name: Upload SARIF
55+
if: always()
56+
# actions/upload-artifact@v4
57+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
58+
with:
59+
name: gitleaks-sarif
60+
path: gitleaks.sarif
61+
if-no-files-found: ignore
62+
retention-days: 7

.github/workflows/release.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ jobs:
5555
permissions:
5656
contents: write # release commits push lerna version bumps + git tags
5757
id-token: write # OIDC for npm publish
58+
packages: write # publish to GitHub Packages mirror
59+
issues: write # comment on release-tracking issues
60+
actions: read # read other workflow runs for context
5861
# Skip if commit message contains [skip ci]. Alpha releases are disabled;
5962
# prerelease GitHub-release events are skipped so tag pushes are the single
6063
# npm publication path for beta versions.
@@ -65,12 +68,6 @@ jobs:
6568
!(github.ref_type == 'tag' && contains(github.ref_name || '', '-alpha'))
6669
}}
6770
68-
permissions:
69-
contents: write
70-
packages: write
71-
issues: write
72-
actions: read
73-
7471
steps:
7572
- name: Checkout code
7673
uses: actions/checkout@v4

0 commit comments

Comments
 (0)