Skip to content

Skip the auto-assign job on pull requests from forks - #40

Draft
Julianacodes wants to merge 1 commit into
procore-oss:mainfrom
Julianacodes:ci/skip-auto-assign-on-forks
Draft

Julianacodes wants to merge 1 commit into
procore-oss:mainfrom
Julianacodes:ci/skip-auto-assign-on-forks

Conversation

@Julianacodes

Copy link
Copy Markdown

Summary

The Auto Author Assign check fails on every pull request opened from a fork, most recently on #39:

##[error]Resource not accessible by integration - https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue

auto-assign-author.yml requests pull-requests: write, but the job log shows the token it actually received:

##[group]GITHUB_TOKEN Permissions
Metadata: read
PullRequests: read
Secret source: None

GitHub forces GITHUB_TOKEN down to read-only for pull_request events originating from a fork, regardless of the permissions block, so the add-assignees call is rejected before it runs.

Worth noting the job would not accomplish anything on these PRs even with a writable token. Assignees who lack push access are silently dropped by the API, and fork authors are typically not collaborators here, so the call would return 201 having assigned nobody.

This gates the job on the PR head living in this repo, so it skips (neutral) on fork PRs rather than failing. Branches pushed directly to procore-oss are unaffected and keep auto-assigning.

Test plan

  • The assign check on this PR reports as skipped rather than failed. This PR is itself from a fork, and the workflow triggers on pull_request (not pull_request_target), so the head-commit version of the file is what runs
  • After merge, confirm a dependabot PR still gets its author assigned

Made with Cursor

GITHUB_TOKEN is forced read-only for pull_request events originating from a
fork, regardless of the permissions block, so the add-assignees call fails with
"Resource not accessible by integration". Fork authors are not assignable on
this repo anyway, so the call would be a silent no-op even with a writable
token. Skip the job instead of failing the check.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Juliana Hernandez <juliana88h@gmail.com>
@Julianacodes
Julianacodes requested a review from a team as a code owner September 2, 2026 14:52
@github-actions github-actions Bot added the repo label Sep 2, 2026
@Julianacodes
Julianacodes marked this pull request as draft September 2, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants