Skip to content

Commit d60771f

Browse files
authored
ci: Try backporting via pull_request_target (#9430)
* ci: Try backporting via pull_request_target * ci: Security improvements
1 parent 548cc4f commit d60771f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/backport.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
name: backport
22

33
on:
4-
pull_request:
4+
# Note that `pull_request_target` has security implications:
5+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
6+
# In particular:
7+
# - Only allow triggers that can be used only be trusted users
8+
# - Don't execute any code from the target branch
9+
# - Don't use cache
10+
pull_request_target:
511
types: [labeled]
612

713
# Set permissions at the job level.
814
permissions: {}
915

1016
jobs:
1117
backport:
12-
if: ${{ startsWith(github.event.label.name, 'backport ') }}
18+
if: startsWith(github.event.label.name, 'backport ') && github.event.pull_request.merged
1319
runs-on: ubuntu-latest
1420
permissions:
1521
contents: write

0 commit comments

Comments
 (0)