Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/governance-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
workflow_dispatch:
jobs:
audit:
permissions:
contents: read
runs-on: ubuntu-latest
Comment on lines 7 to 10
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 | Confidence: High

The PR fixes a security alert by adding a minimal permissions: contents: read block to the job. However, this specific permission is insufficient for the actual API call being made (gh api repos/${{ github.repository }}/branches/main/protection). Reading branch protection settings requires the repository permission scope, not just contents. The contents: read permission grants access to repository content (code, files), but not to repository settings like branch protection rules. This job will now fail with a 403 Forbidden error when it runs, breaking the scheduled governance check.

Suggested change
audit:
permissions:
contents: read
runs-on: ubuntu-latest
jobs:
audit:
permissions:
repository: read
runs-on: ubuntu-latest

Evidence: search:gh api, search:protection

steps:
- name: Check branch protections
Expand Down
Loading