Skip to content

Fix ABAP Doc Casing Check permissions for fork PRs#768

Merged
albertmink merged 2 commits intomainfrom
fix-abap-doc-casing-permissions
Apr 20, 2026
Merged

Fix ABAP Doc Casing Check permissions for fork PRs#768
albertmink merged 2 commits intomainfrom
fix-abap-doc-casing-permissions

Conversation

@wurzka
Copy link
Copy Markdown
Contributor

@wurzka wurzka commented Apr 20, 2026

Problem

The ABAP Doc Casing Check workflow fails on PRs from forks with the error:

GraphQL: Resource not accessible by integration (addComment)

This is visible in PR #737 where the "Post casing checklist on PR" job fails.

Root Cause

When using pull_request trigger, workflows from fork PRs run with read-only GITHUB_TOKEN permissions as a security measure. Even though we declare pull-requests: write in permissions, GitHub restricts this for fork PRs.

Solution

Changed from pull_request to pull_request_target:

  • pull_request_target runs in the context of the base repository (not the fork)
  • This gives the workflow write permissions to post comments
  • Safe for this workflow since it only posts a checklist comment, no code execution from the fork

Also updated event references from github.event.pull_request.number to github.event.number as the PR number is at the top level for pull_request_target events.

Testing

This fix will allow the workflow to successfully post checklist comments on fork PRs like #737.

Change from pull_request to pull_request_target to allow the workflow
to post comments on PRs from forks. With pull_request, the GITHUB_TOKEN
has read-only permissions when triggered from a fork, causing the
"Resource not accessible by integration" error.

Using pull_request_target runs the workflow in the context of the base
repository with write permissions, allowing it to post the checklist
comment.

Also updated event.pull_request.number to event.number as the PR number
is at the top level for pull_request_target events.

Fixes the failure in PR #737 where the checklist posting was blocked.
@hyperspace-insights
Copy link
Copy Markdown

Control Panel

Hi, I'm an AI-powered Review Bot that helps you with summarizing and reviewing pull requests.
To interact with me, just use the following actions:

  • 📝 Summarize PR
  • 🔍 Review
  • 🗑️ Delete all bot comments and reviews

💌 Have ideas or want to contribute? Create an issue and share your thoughts with us!
📑 Check out the documentation for more information.
📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

Made with ❤️ by Hyperspace.

@wurzka wurzka requested a review from albertmink April 20, 2026 14:22
Copy link
Copy Markdown
Contributor

@albertmink albertmink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Maybe this Action is getting replace with the Hyperspace bot 🤖

@albertmink albertmink merged commit 194be67 into main Apr 20, 2026
9 checks passed
@albertmink albertmink deleted the fix-abap-doc-casing-permissions branch April 20, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants