GitHub Actions / Editorial solution guide
An API operation reports Resource not accessible by integration
Identify token, resource, event, and effective permissions before broadening authority.
Read-only knowledge base · No public comments
Recognize the symptoms
An Actions job can read source or run tests but a later GitHub API operation fails with an authorization response such as Resource not accessible by integration. The message alone does not identify which policy layer denied access.
A similar operation may succeed for an integration push but fail for a fork pull request, a reusable workflow, or a different target repository. A secret can also be absent or empty in one event context without the application itself being broken.
Understand the likely causes
- The requested operation may require a capability absent from the job’s effective GITHUB_TOKEN permissions, target a resource outside the token’s scope, or be constrained by event and organization policy.
- A dependency may access github.token implicitly, and a called workflow may receive different secrets or environment selection than expected. Replacing every token with a broad personal credential can cross the trust boundary that correctly blocked the original operation.
Identify the exact denied operation
Record the API operation category, resource ownership, run event, revision, job, and token type without retaining the bearer value. Distinguish source read, issue or pull-request modification, release publication, and package access. Identify which step actually calls the API; an action can make requests internally even if no shell command is visible. The successful earlier test is separate evidence and should remain separate from the publication or metadata failure.
Review declarations and inherited restrictions
Read workflow-level and job-level permissions alongside repository defaults and inherited organization policy. Check event-specific restrictions, particularly fork validation. For a reusable workflow, review the caller and called chain; nested reuse cannot simply elevate token authority beyond the permitted caller context. Confirm the resource is in scope. A correctly scoped token for one repository is not automatically a cross-repository credential just because the same user owns both.
Compare responsibility with capability
The following local model asks whether declared capabilities cover a task. It cannot determine real GitHub authorization and does not inspect a token. It makes the review question concrete: which trusted job owns the denied action, and which minimal capability should it have if that action is actually authorized?
tasks = {"read-source": {"contents:read"}, "publish-release": {"contents:write"}}
granted = {"contents:read"}
for name, required in tasks.items():
print(name, required <= granted)
read-source True
publish-release False
The names are illustrative permission labels. Actual API requirements, token resource scope, event restrictions, and repository policy must be reviewed independently.
Keep untrusted validation restricted
If a trusted publication job legitimately lacks one capability, review that narrow grant on that job. If untrusted proposal code is attempting a privileged action, separate the operation instead of granting the proposal authority. If the target is outside GITHUB_TOKEN scope, select an appropriate authorized identity through the repository’s security process rather than embedding a personal secret. Validate secret presence without printing it, and review environment-secret selection before moving a value into broader repository or organization scope.
Verify the fix
Use a separately authorized lab or existing request evidence to verify the intended trusted operation succeeds with the minimum effective capability, while untrusted and out-of-scope cases remain denied. Confirm tests, publication, and reporting preserve separate results. No API request, secret change, permission change, or credential operation is performed by this guide.
Keep it from recurring
- Document permission rationale per privileged job, minimize implicit token authority for dependencies, and review event trust when adding API operations. Keep resource ownership and reusable-workflow secret contracts visible. Treat recurring authorization errors as a design question before reaching for write-all or a long-lived credential.