Created
August 22, 2022 16:25
-
-
Save parkerproject/2a9e18a1407c82847f1c994c5d716f94 to your computer and use it in GitHub Desktop.
This file contains 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
# https://stackoverflow.com/questions/69343233/github-action-increment-version-on-push-to-main | |
name: Version Increment | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: git config user.email "[email protected]" | |
- run: git config user.name "$GITHUB_ACTOR" | |
- run: npm version minor -m "v%s" | |
- run: VERSION=$(node -p "require('./package.json').version") | |
- run: git tag ${VERSION} | |
- run: git push "https://$GITHUB_ACTOR:${{ secrets.ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" --follow-tags | |
- run: git push "https://$GITHUB_ACTOR:${{ secrets.ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment