Skip to content

Commit 3844aff

Browse files
authored
Update backport PR conditions (#1826)
* update run action conditions * noop change for testing (#1822) * remove create app token step * update to only run when labeling a merged pr * noop to test backport pr (#1824) * testing (#1825)
1 parent b453027 commit 3844aff

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

.github/workflows/backport-pr.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Backport PR
22
on:
33
pull_request:
4-
types: [ labeled, closed ]
4+
types: [ labeled ]
55

66
permissions: {}
77

@@ -10,26 +10,18 @@ jobs:
1010
name: Backport PR
1111
runs-on: ubuntu-latest
1212
if: >
13-
github.event.pull_request.merged
14-
&& (
15-
( github.event.action == 'closed' && contains(github.event.label.name, 'backport') )
16-
||
17-
( github.event.action == 'labeled' && contains(github.event.label.name, 'backport') )
18-
)
13+
github.event.action == 'labeled'
14+
&& github.event.pull_request.merged_at != null
15+
&& contains(github.event.label.name, 'backport/')
1916
permissions:
2017
contents: write
2118
pull-requests: write
2219
steps:
23-
- uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
24-
id: app-token
25-
with:
26-
app-id: ${{ vars.DD_GITHUB_TOKEN_GENERATOR_APP_ID }}
27-
private-key: ${{ secrets.DD_GITHUB_TOKEN_GENERATOR_PRIVATE_KEY }}
2820
- uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4
2921
with:
3022
label_pattern: "^backport/(?<base>([^ ]+))$"
3123
labels_template: "<%= JSON.stringify([...labels, 'backport', 'bot']) %>"
32-
github_token: ${{ steps.app-token.outputs.token }}
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
3325
title_template: "[ Backport <%- base %> ] <%- title %>"
3426
body_template: |
3527
Backport <%- mergeCommitSha %> from #<%- number %>.

0 commit comments

Comments
 (0)