8000 Run permissions step on `pull_request_target` but not `push` (#2548) · davidcroda/sentry-python@e9b5855 · GitHub
[go: up one dir, main page]

Skip to content

Commit e9b5855

Browse files
authored
Run permissions step on pull_request_target but not push (getsentry#2548)
1 parent cd3f08b commit e9b5855

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/test-integration-aws_lambda.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
3333
with:
3434
persist-credentials: false
35-
- name: permissions
35+
- name: Check permissions on PR
36+
if: github.event_name == 'pull_request_target'
3637
run: |
3738
python3 -uS .github/workflows/scripts/trigger_tests_on_label.py \
3839
--repo-id ${{ github.event.repository.id }} \
@@ -45,6 +46,9 @@ jobs:
4546
# these can contain special characters
4647
ARG_USERNAME: ${{ github.event.pull_request.user.login }}
4748
ARG_LABEL_NAMES: ${{ toJSON(github.event.pull_request.labels.*.name) }}
49+
- name: Check permissions on repo branch
50+
if: github.event_name == 'push'
51+
run: true
4852
test-pinned:
4953
needs: check-permissions
5054
timeout-minutes: 30

scripts/split-tox-gh-actions/templates/check_permissions.jinja

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
with:
77
persist-credentials: false
88

9-
- name: permissions
9+
- name: Check permissions on PR
10+
if: github.event_name == 'pull_request_target'
1011
run: |
1112
{% raw %}
1213
python3 -uS .github/workflows/scripts/trigger_tests_on_label.py \
@@ -23,3 +24,7 @@
2324
ARG_USERNAME: ${{ github.event.pull_request.user.login }}
2425
ARG_LABEL_NAMES: ${{ toJSON(github.event.pull_request.labels.*.name) }}
2526
{% endraw %}
27+
28+
- name: Check permissions on repo branch
29+
if: github.event_name == 'push'
30+
run: true

0 commit comments

Comments
 (0)
0