Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/welcome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Post welcome comment
on:
pull_request:
types: [opened]
Comment on lines +2 to +4

Choose a reason for hiding this comment

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

P1 Badge Comment workflow uses pull_request event

This job is triggered with pull_request but then tries to post a comment with gh pr comment. For pull requests coming from forks, GitHub always supplies a read‑only token to pull_request workflows and ignores the requested pull-requests: write permission, so the step will fail with a 403 and the welcome message is never posted for external contributors. If the intent is to welcome all PRs, the workflow needs to run on pull_request_target or another context that has a writable token.

Useful? React with 👍 / 👎.

permissions:
pull-requests: write
jobs:
welcome:
name: Post welcome comment
runs-on: ubuntu-latest
steps:
- run: gh pr comment "$PR_URL" --body "Welcome to the repository!"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
Loading