Skip to content

ci: Add explicit permissions to workflows - #125

Merged
philippemnoel merged 1 commit into
mainfrom
harden/workflow-permissions
Jul 20, 2026
Merged

ci: Add explicit permissions to workflows#125
philippemnoel merged 1 commit into
mainfrom
harden/workflow-permissions

Conversation

@philippemnoel

Copy link
Copy Markdown
Member

Every workflow lacking a permissions: block inherits the repository default for GITHUB_TOKEN, which is currently write across the org. That grants linters and test workflows push access they never use.

This adds a minimal top-level block to each workflow that had none:

  • contents: read for linters, tests, and workflows that authenticate to external services with their own credentials
  • elevated scopes only where the workflow demonstrably needs them (release publishing, issue creation)

Workflows that already declare workflow- or job-level permissions are untouched. Pure additions, no deletions.

This is a prerequisite for switching the org default workflow permissions to read-only — flipping that setting first would break the workflows that currently rely on implicit write.

Found via GitHub's Code Security assessment ("Workflow does not contain permissions", Medium, 35 findings), then audited across all non-archived, non-fork repos.

https://claude.ai/code/session_01Rg3UBFSnmKMPQLNpNKkn8d

Every workflow lacking a `permissions:` block inherits the repository
default for GITHUB_TOKEN, which is currently `write` across the org.
This grants linters and test workflows push access they never use.

Adds a minimal top-level block to each workflow that had none, with
elevated scopes only where demonstrably required. Workflows with
existing workflow- or job-level permissions are untouched.

Prerequisite for switching the org default workflow permissions to
read-only.

Claude-Session: https://claude.ai/code/session_01Rg3UBFSnmKMPQLNpNKkn8d
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.37%. Comparing base (73cf5e3) to head (3646ded).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #125   +/-   ##
=======================================
  Coverage   90.37%   90.37%           
=======================================
  Files          20       20           
  Lines        2411     2411           
  Branches      774      774           
=======================================
  Hits         2179     2179           
- Misses        190      232   +42     
+ Partials       42        0   -42     
Flag Coverage Δ
rails-paradedb 90.37% <ø> (ø)
rb3.2 90.65% <ø> (ø)
rb3.3 90.65% <ø> (ø)
rb3.4 90.37% <ø> (ø)
rb4.0 81.87% <ø> (ø)
rl7.2 90.37% <ø> (ø)
rl8.1 81.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@philippemnoel
philippemnoel merged commit 1918650 into main Jul 20, 2026
17 checks passed
@philippemnoel
philippemnoel deleted the harden/workflow-permissions branch July 20, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant