Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: filter labels before cherry picking #3185

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading