Skip to content

Commit d3db640

Browse files
authored
Trigger pick-to-staging if any label matches (#3301)
1 parent d03aa2f commit d3db640

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/pick-to-staging.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ on:
1010

1111
jobs:
1212
create-pr-for-staging:
13+
# contains(join()) to first join all labels into one string and then check
14+
# if contains 'staging'
1315
if: |
1416
github.event.pull_request.merged == true &&
15-
contains(github.event.pull_request.labels.*.name, 'staging')
17+
contains(join(github.event.pull_request.labels.*.name, ''), 'staging')
1618
name: Create PR against staging branch
1719
runs-on: ubuntu-latest
1820
strategy:
@@ -76,7 +78,7 @@ jobs:
7678
uses: peter-evans/create-pull-request@v8
7779
with:
7880
token: ${{ steps.generate-token.outputs.token }}
79-
branch: apply/commit-${{ github.sha }}
81+
branch: apply/${{ matrix.label }}/commit-${{ github.sha }}
8082
delete-branch: true
8183
title: "[Cherry-Pick] ${{ github.event.pull_request.title }}"
8284
body: "Triggered by commit [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})\n\n${{ steps.cherry-pick.outputs.error && 'There were conflicts during the cherry-pick. These were commited without any resolving. Please resolve them manually and push the result to this branch before merging.' || 'The cherry-pick was successful without any conflicts. You should be able to simply merge this PR.' }}"

0 commit comments

Comments
 (0)