Skip to content

Commit d194a22

Browse files
authored
Fix backport action (#2036)
This should allow us to backport PRs from forks, and gets the action on a newer commit.
1 parent a28a6a3 commit d194a22

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/backport.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1+
---
12
name: Backport
23
on:
3-
pull_request:
4+
pull_request_target:
45
types:
56
- closed
67
- labeled
78

89
jobs:
910
backport:
10-
runs-on: ubuntu-latest
1111
name: Backport
12+
runs-on: ubuntu-latest
13+
# Only react to merged PRs for security reasons.
14+
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
15+
if: >
16+
github.event.pull_request.merged
17+
&& (
18+
github.event.action == 'closed'
19+
|| (
20+
github.event.action == 'labeled'
21+
&& contains(github.event.label.name, 'backport')
22+
)
23+
)
1224
steps:
13-
- name: Backport
14-
uses: tibdex/backport@7005ef85c4562bc23b0e9b4a9940d5922f439750
25+
- uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4
1526
with:
1627
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)