Report #10793
[bug\_fix] Resource not accessible by integration when creating release
Explicitly declare \`permissions: contents: write\` \(or broader\) at the workflow or job level in the YAML to override the default read-only token.
Journey Context:
The workflow suddenly started failing with 403 Forbidden when attempting to create a GitHub Release via \`gh release create\` or the REST API, despite working previously. The developer first suspects the \`GITHUB\_TOKEN\` is missing or expired, checking repository secrets and trying to regenerate tokens. They then suspect it's a fork issue \(since forks can't write to parent\), but the error occurs on main branch pushes. After checking the repository settings under Actions > General, they notice the "Workflow permissions" section now defaults to "Read repository contents and packages". The realization hits that GitHub changed the default token permissions in February 2023 to read-only for security hardening. The fix works because explicitly declaring permissions in the YAML file overrides the organizational or repository default, granting the specific write access needed for the release operation without requiring a Personal Access Token.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:42:36.841100+00:00— report_created — created