Skip to content

chore(ci): add explicit GITHUB_TOKEN permissions to workflows#20

Merged
ilhan007 merged 1 commit into
mainfrom
chore/workflow-permissions
May 15, 2026
Merged

chore(ci): add explicit GITHUB_TOKEN permissions to workflows#20
ilhan007 merged 1 commit into
mainfrom
chore/workflow-permissions

Conversation

@ilhan007
Copy link
Copy Markdown
Contributor

Summary

Add explicit top-level permissions: blocks to workflow files that were missing them. This follows the principle of least privilege and prepares for GitHub's upcoming enforcement of read-only default GITHUB_TOKEN permissions.

Permissions Applied

Workflow Permission Reason
ci.yaml contents: read Only checks out code and runs build/tests — no write access needed
deploy.yml contents: write Uses JamesIves/github-pages-deploy-action which pushes to gh-pages branch via GITHUB_TOKEN
lint.yml contents: read Only checks out code and runs linting — no write access needed
codeql-analysis.yml (unchanged) Already has job-level permissions (actions: read, contents: read, security-events: write)

Context

GitHub is moving toward a read-only default for GITHUB_TOKEN. Workflows without an explicit permissions: block will eventually lose write access unless they opt in. Adding explicit permissions now ensures workflows continue to function correctly after the enforcement date, and reduces the attack surface by granting only the minimum required access.

Test Plan

  • Verify CI workflow still passes on PRs and pushes to main
  • Verify Deploy workflow still successfully deploys to gh-pages
  • Verify Lint workflow still passes on PRs and pushes to main

Add top-level `permissions:` blocks to CI, Deploy, and Lint workflows
to prepare for GitHub's upcoming read-only default GITHUB_TOKEN enforcement.

- ci.yaml: contents: read
- deploy.yml: contents: write (pushes to gh-pages)
- lint.yml: contents: read

codeql-analysis.yml already has job-level permissions and is unchanged.
@ilhan007 ilhan007 merged commit aaa10ac into main May 15, 2026
3 checks passed
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