Skip to content

Commit 8b04aa2

Browse files
committed
NO-JIRA: fix notify-team-to-review-pr.yml by using pull_request_target to resolve 403 error
1 parent a9606b3 commit 8b04aa2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/notify-team-to-review-pr.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
name: Add Review Requested Label
33
on: # yamllint disable-line rule:truthy
4-
pull_request:
4+
# the regular `secrets.GITHUB_TOKEN` with `on: pull_request` results in a 403 error
5+
# HttpError: Resource not accessible by integration
6+
pull_request_target:
57
types: [opened]
68

79
permissions:
@@ -14,9 +16,13 @@ jobs:
1416
if: contains(github.event.pull_request.labels.*.name, 'konflux-nudge') == false
1517
runs-on: ubuntu-latest
1618
steps:
19+
20+
# SECURITY: never clone untrusted code in pull_request_target workflows
21+
1722
- name: Add review-requested label
1823
uses: actions/github-script@v7
1924
with:
25+
github-token: ${{ secrets.GITHUB_TOKEN }}
2026
# language=javascript
2127
script: |
2228
await github.rest.issues.addLabels({

0 commit comments

Comments
 (0)