Bump Version #1
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: Bump Version | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| bumpPart: | |
| description: 'Bump part (major, minor or patch)' | |
| required: true | |
| default: "minor" | |
| # Add permission to push to repo | |
| permissions: | |
| contents: write | |
| # Allow only 1 concurrent execution | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| bump: | |
| name: Bump App Version | |
| runs-on: ubuntu-latest | |
| # Sanity check on the input | |
| if: contains(['major', 'minor', 'patch'], ${{ github.event.inputs.bumpPart }}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Bump version | |
| id: bumpversion | |
| uses: jasonamyers/[email protected] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DEFAULT_BUMP: ${{ github.event.inputs.bumpPart }} | |
| - name: Push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
| git push "$remote_repo" HEAD:"${GITHUB_REF#refs/heads/}" |