Skip to content

ci: declare least-privilege GITHUB_TOKEN permissions - #51

Merged
windkh merged 1 commit into
mainfrom
chore/workflow-permissions
Aug 20, 2026
Merged

ci: declare least-privilege GITHUB_TOKEN permissions#51
windkh merged 1 commit into
mainfrom
chore/workflow-permissions

Conversation

@windkh

@windkh windkh commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Brings both workflows up to node-red-standards 0.6.1. This repo and node-red-contrib-shelly are the two that were left behind when the permissions pass went through the others — and the reason is worth naming: they are exactly the two repos without code scanning enabled. The same gap existed here, nothing reported it.

Both files differ from the current template by nothing but the permissions block, so this is an exact template match rather than a merge.

Why it matters

A workflow with no permissions: block inherits the repository default, which on many repos is read and write to everything — so a compromised action or a malicious dependency in a CI run gets a token that can push commits. Both files now start from contents: read; in npm-publish.yml the one job that needs more (github-release, which creates the release) raises itself to contents: write. npm authentication is a separate secret and is unaffected.

In the four repos that do have code scanning this closed 13 actions/missing-workflow-permissions alerts.

Verified locally: npm run lint, npm run format:check and all 20 tests pass; both files parse as YAML.

node-red-standards 0.6.1. A workflow with no permissions block inherits the
repository default, which on many repos is read *and write* to everything -- so a
compromised action or a malicious dependency in a CI run gets a token that can
push commits. Both workflows now start from contents: read; github-release
raises itself to contents: write because it creates the release. npm
authentication is a separate secret and is unaffected.

This repo and node-red-contrib-ntrip were the two left behind when the
permissions pass went through the others, and the reason is worth naming: they
are exactly the two without code scanning enabled. The same gap was here,
nothing reported it. In the four repos that do have it this closed 13
actions/missing-workflow-permissions alerts.

Verified: lint, format:check and 20 tests pass; both files parse as YAML.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@windkh
windkh merged commit 347a970 into main Aug 20, 2026
6 checks passed
@windkh
windkh deleted the chore/workflow-permissions branch August 20, 2026 21:02
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