Skip to content

action.nix: give generated workflows permissions: contents: read - #496

Open
JasonGross wants to merge 1 commit into
rocq-community:masterfrom
JasonGross:action-default-permissions
Open

action.nix: give generated workflows permissions: contents: read#496
JasonGross wants to merge 1 commit into
rocq-community:masterfrom
JasonGross:action-default-permissions

Conversation

@JasonGross

@JasonGross JasonGross commented Jul 30, 2026

Copy link
Copy Markdown
Member

Adds permissions: contents: read to every workflow generated by mkActionFromJobs.

On pull_request_target, GITHUB_TOKEN belongs to the target repository and may be writable. action.nix does not use it; Cachix uses separate authToken/signingKey secrets. The declaration therefore removes unneeded access.

This updates action.nix and regenerates eleven workflows with:

nix-shell --arg do-nothing true --run genNixActions

Only two lines change per file, confirming they were otherwise synchronized.

🤖 Generated with Claude Code

Wordsmithed by Codex.

The generated jobs only read the repository: nothing in action.nix uses
GITHUB_TOKEN, and the cachix steps authenticate with their own secrets.  But
the workflows run on `pull_request_target`, where the token belongs to the
target repository and is writable by default unless the repository owner has
changed "Workflow permissions" in the repository settings.  Declaring the
minimum in the workflow itself makes the generated CI safe by default rather
than safe-if-configured.

The .github/workflows/*.yml here are `genNixActions` output; the only change to
them is the two new lines.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9BGQT7XUuubV6C619DW4b
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