Skip to content

Commit

Permalink
build: filter labels before cherry picking (#3185)
Browse files Browse the repository at this point in the history
(cherry picked from commit 772e899)
  • Loading branch information
jeripeierSBB committed Oct 28, 2024
1 parent b1eb196 commit 4317f47
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/maintenance-cherry-pick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,28 @@ jobs:
steps:
- run: echo Labels are not empty, continuing

cherry_pick:
filter_labels:
needs: [check_labels]
runs-on: ubuntu-latest
outputs:
filtered_labels: ${{ steps.filter.outputs.filtered_labels }}
steps:
- name: Filter labels
id: filter
run: |
FILTERED_LABELS=$(jq -r '.pull_request.labels | map(select(.name | test("^target: [0-9]+\\.x$"))) | .[].name' <<< "${{ toJSON(github.event) }}")
echo "filtered_labels=${FILTERED_LABELS}" >> $GITHUB_OUTPUT
cherry_pick:
needs: [filter_labels]
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true &&
github.event.pull_request.user.login != 'renovate[bot]'
outputs:
failed_branches: ${{ steps.update_failed_branches.outputs.failed_branches }}
strategy:
matrix:
label: ${{ github.event.pull_request.labels.*.name }}
label: ${{ fromJson(needs.filter_labels.outputs.filtered_labels) }}

steps:
- name: Get token
Expand All @@ -49,7 +61,7 @@ jobs:
token: ${{ steps.get_token.outputs.token }}
fetch-depth: 0

- name: Cherry-pick changes into ${{ steps.branch_name.outputs.branch }}
- name: Cherry-pick changes into ${{ steps.branch_name.outputs.branch }}
if: steps.branch_name.outputs.branch
run: |
git checkout ${{ steps.branch_name.outputs.branch }}
Expand Down

0 comments on commit 4317f47

Please sign in to comment.