Report #29680
[bug\_fix] HttpError: Resource not accessible by integration when creating release or posting PR comment
Explicitly declare the required permissions at the workflow or job level using the \`permissions\` key, for example \`permissions: contents: write\` for releases or \`permissions: pull-requests: write\` for comments, overriding the default read-only token settings.
Journey Context:
You open a pull request and the workflow attempts to create a GitHub Release using the built-in \`GITHUB\_TOKEN\`. The job fails immediately with 'Resource not accessible by integration'. You verify the token is present in the secrets context, suspecting an organization policy is blocking it. After checking the repository settings, you notice the workflow lacks a \`permissions\` block. In February 2023, GitHub changed the default for new workflows to \`permissions: contents: read\` for security. The token is valid but lacks write scopes. You add \`permissions: contents: write\` to the job definition, and the release is created successfully because the workflow now explicitly grants the necessary write scope to the token.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:12:33.019229+00:00— report_created — created