Release/11.14.0 #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Release: Bump Version" | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - dev/11 | |
| - release/* | |
| jobs: | |
| bump-and-tag: | |
| # On ne s'exécute que si la PR est fusionnée | |
| if: github.event.pull_request.merged == true | |
| runs-on: self-hosted | |
| # Indispensable sur Enterprise pour autoriser l'écriture | |
| permissions: | |
| contents: write | |
| pull-requests: read | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Retrieves the target branch (base) of the PR | |
| ref: ${{ github.event.pull_request.base.ref }} | |
| token: ${{ secrets.RELEASE_BOT_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Configure Git Bot | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| - name: Bump Version | |
| id: npm_bump | |
| run: | | |
| # We dynamically retrieve the name of the target branch | |
| TARGET_BRANCH=${{ github.event.pull_request.base.ref }} | |
| echo "Merge detected on : $TARGET_BRANCH" | |
| # Increment | |
| npm version patch -m "chore(release): %s [skip ci]" | |
| - name: Push Changes | |
| run: | | |
| # We push the commit for package.json and the Git tag to GitHub Enterprise | |
| git push origin $TARGET_BRANCH --follow-tags |