Skip to content

chore(deps): update bazel to v8 (19.x) (major) #801

chore(deps): update bazel to v8 (19.x) (major)

chore(deps): update bazel to v8 (19.x) (major) #801

name: cherry-pick into target branches
on:
pull_request:
types: [closed]
permissions:
actions: write
issues: write
jobs:
# Check if labels exist before executing the next job.
# We cannot use `if` because the matrix is evaluated before the `if` statement.
check_labels:
runs-on: ubuntu-latest
if: ${{ join(github.event.pull_request.labels) != '' }}
steps:
- run: echo Labels are not empty, continuing
cherry_pick:
needs: [check_labels]
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true &&
github.event.pull_request.user.login != 'sbb-angular-renovate[bot]'
outputs:
failed_branches: ${{ steps.update_failed_branches.outputs.failed_branches }}
strategy:
matrix:
label: ${{ github.event.pull_request.labels.*.name }}
steps:
- name: Get token
id: get_token
uses: machine-learning-apps/actions-app-token@master
with:
APP_ID: ${{ secrets.MAINTENANCE_APP_ID }}
APP_PEM: ${{ secrets.MAINTENANCE_APP_PEM }}
- name: Get branch name from label
id: branch_name
run: |
echo "branch=$(echo ${{ matrix.label }} | sed -n 's/target: \([0-9]*.x\).*/\1/p')" >> $GITHUB_OUTPUT
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
if: steps.branch_name.outputs.branch
with:
token: ${{ steps.get_token.outputs.app_token }}
fetch-depth: 0
- name: Cherry-pick changes into ${{ steps.branch_name.outputs.branch }}
if: steps.branch_name.outputs.branch
run: |
git checkout ${{ steps.branch_name.outputs.branch }}
git -c user.name="github-actions" -c user.email="[email protected]" cherry-pick ${{ github.sha }}
git push
- name: Update failed branches
if: ${{ failure() }}
id: update_failed_branches
run: |
echo "failed_branches=$(echo ${{ steps.branch_name.outputs.branch }} ${{ steps.update_failed_branches.outputs.failed_branches}})" >> $GITHUB_OUTPUT
update_maintenance_issue:
runs-on: ubuntu-latest
needs: cherry_pick
if: always() && needs.cherry_pick.result == 'failure' &&
github.event.pull_request.user.login != 'sbb-angular-renovate[bot]'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@v4
if: needs.cherry_pick.outputs.failed_branches
with:
node-version-file: '.nvmrc'
- uses: ./.github/actions/yarn-install
if: needs.cherry_pick.outputs.failed_branches
- name: Update maintenance issue
if: needs.cherry_pick.outputs.failed_branches
run: node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/update-maintenance-issue.mts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
FAILED_BRANCHES: ${{ needs.cherry_pick.outputs.failed_branches }}