Skip to content

fix(api): allow read-only pull request access for fork PR Actions token #38444 - #38889

Open
gomitrah wants to merge 2 commits into
go-gitea:mainfrom
gomitrah:fix/actions-fork-pr-token-pull-request-read
Open

fix(api): allow read-only pull request access for fork PR Actions token #38444#38889
gomitrah wants to merge 2 commits into
go-gitea:mainfrom
gomitrah:fix/actions-fork-pr-token-pull-request-read

Conversation

@gomitrah

Copy link
Copy Markdown
Contributor

Actions tokens for workflows triggered by a fork pull request were
clamped to a permission set with no access to Issues/PullRequests at
all, even when the workflow runs against its own base repo. This made
mustAllowPulls reject any PR API call (e.g. listing PR reviews) for
fork-triggered CI jobs with a 404, while identical calls from non-fork
PRs succeeded.

Fork PR tokens are documented as being restricted to read-only access,
not no access. This adds a dedicated read-only permission ceiling for
the fork-PR/cross-repo clamp instead of reusing the admin-configured
"Restricted" mode preset (which intentionally excludes Issues/PRs and
must stay unchanged).

Fixes #38444

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 12, 2026
@github-actions github-actions Bot added topic/api Concerns mainly the API type/bug labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/api Concerns mainly the API type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The API in CI processing when the branch repository submits PR to the main repository returns 404

2 participants