Skip to content

Commit db12a6a

Browse files
committed
fix(ci): remove elevated permissions from gitleaks-action and disable comments
1 parent acca347 commit db12a6a

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

.github/workflows/secret-scanner-reusable.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,7 @@ jobs:
8686
permissions:
8787
contents: read
8888
# gitleaks-action's `ScanPullRequest` posts a summary comment via
89-
# the GitHub Issues/PR API. Without `pull-requests: write` it fails
90-
# with "Resource not accessible by integration" AFTER the gitleaks
91-
# scan itself succeeds. Reusable-workflow permission blocks
92-
# OVERRIDE the caller's, so this MUST live here at source.
93-
# See .git-private-farm#69 for the reproducing logs.
94-
pull-requests: write
95-
# Additional API calls inside `ScanPullRequest` (workflow-run
96-
# metadata, PR-files endpoint) require `actions: read`.
97-
actions: read
89+
# the GitHub Issues/PR API. We disabled it via env vars below.
9890
steps:
9991
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
10092
with:
@@ -105,6 +97,8 @@ jobs:
10597
uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
10698
env:
10799
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
GITLEAKS_ENABLE_COMMENTS: false
101+
GITLEAKS_ENABLE_SUMMARY: false
108102

109103
# Rust-specific: hardcoded crypto values. Self-skips when no Cargo.toml
110104
# is present, so this job is safe to run on non-Rust repos.

.github/workflows/secret-scanner.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@ permissions:
1515

1616
jobs:
1717
scan:
18-
# The reusable's gitleaks job requests pull-requests: write (PR
19-
# summary comments, .git-private-farm#69) and actions: read. A
20-
# called workflow cannot exceed the caller's grant — without these
21-
# here every run dies at startup_failure.
18+
# The reusable's gitleaks job no longer requests elevated permissions
2219
permissions:
2320
contents: read
24-
pull-requests: write
25-
actions: read
2621
uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@891b1ed6164478616cb3375f328c6487ccb13f80
2722
secrets: inherit

0 commit comments

Comments
 (0)