Skip to content

chore(release): 18.1.0 #76

chore(release): 18.1.0

chore(release): 18.1.0 #76

name: cherry-pick changelog from release branch into default branch
on:
push:
tags: ['*.*']
permissions:
actions: write
issues: write
jobs:
cherry_pick:
runs-on: ubuntu-latest
outputs:
failed_release_version: ${{ steps.cherry_pick_error.outputs.failed_release_version }}
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 }}
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
token: ${{ steps.get_token.outputs.app_token }}
fetch-depth: 0
- name: Get tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Get commit for tag
run: echo "TAG_COMMIT=$(git rev-list -n 1 ${{ env.RELEASE_VERSION }})" >> $GITHUB_ENV
- name: Cherry-pick CHANGELOG.md into ${{ github.event.repository.default_branch }}
run: |
git config user.email "[email protected]"
git config user.name "github-actions"
git checkout ${{ github.event.repository.default_branch }}
git show ${{ env.TAG_COMMIT }} -- CHANGELOG.md | git apply -
git commit -a -m "chore: update changelog"
git push
- name: Handling error
if: ${{ failure() }}
id: cherry_pick_error
run: echo "failed_release_version=$(echo ${{ env.RELEASE_VERSION }})" >> $GITHUB_OUTPUT
update_maintenance_issue:
runs-on: ubuntu-latest
needs: cherry_pick
if: always() && needs.cherry_pick.result == 'failure'
steps:
- run: echo ${{ needs.cherry_pick.outputs.failed_release_version }}
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- uses: actions/setup-node@v4
if: needs.cherry_pick.outputs.failed_release_version
with:
node-version-file: '.nvmrc'
- uses: ./.github/actions/yarn-install
if: needs.cherry_pick.outputs.failed_release_version
- name: Update maintenance issue
if: needs.cherry_pick.outputs.failed_release_version
run: node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/update-maintenance-issue.mts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FAILED_RELEASE: ${{ needs.cherry_pick.outputs.failed_release_version }}