Skip to content

Commit faafedb

Browse files
committed
[ci] Add fix for contribution message not working for PRs from fork
1 parent 84757ce commit faafedb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/contribution-message.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: Post contribution message in pull request
22
on:
3-
pull_request:
3+
pull_request_target:
44
types: [opened, reopened]
55

66
permissions:
7-
contents: write
7+
# Only scope GITHUB_TOKEN to write for pull requests, others set to none (by default) for security reasons since we are using pull_request_target trigger
88
pull-requests: write
99

1010
jobs:
1111
post_contribution_message:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v6
14+
- name: Checkout repository # Checks out to base repository by default
15+
uses: actions/checkout@v6 # DO NOT CHECKOUT TO HEAD UNSAFE (will checkout to head of the fork)
1616

1717
- name: Setup Python
1818
uses: actions/setup-python@v5

0 commit comments

Comments
 (0)