Skip to content

Instantly share code, notes, and snippets.

@larskarbo
Last active June 4, 2022 09:20
Show Gist options
  • Save larskarbo/f7bfeb9fb08bd8343d13fcb33bdfcae1 to your computer and use it in GitHub Desktop.
Save larskarbo/f7bfeb9fb08bd8343d13fcb33bdfcae1 to your computer and use it in GitHub Desktop.
name: "Bump Version"
on:
push:
branches:
- main
jobs:
bump-version:
name: "Bump Version on main"
runs-on: ubuntu-latest
steps:
- name: Temporarily disable "include administrators" branch protection
uses: benjefferies/branch-protection-bot@master
if: always()
with:
access_token: ${{ secrets.BOT_USER_TOKEN }}
branch: ${{ github.event.repository.default_branch }}
enforce_admins: false
- name: "Checkout source code"
uses: "actions/checkout@v2"
with:
ref: ${{ github.ref }}
token: ${{ secrets.BOT_USER_TOKEN }}
- name: "cat package.json"
run: cat ./package.json
- name: "Automated Version Bump"
id: version-bump
uses: "phips28/gh-action-bump-version@master"
with:
tag-prefix: "v"
env:
GITHUB_TOKEN: ${{ secrets.BOT_USER_TOKEN }}
- name: "cat package.json"
run: cat ./package.json
- name: "Output Step"
env:
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
run: echo "new tag $NEW_TAG"
- name: Enable "include administrators" branch protection
uses: benjefferies/branch-protection-bot@master
if: always()
with:
access_token: ${{ secrets.BOT_USER_TOKEN }}
branch: ${{ github.event.repository.default_branch }}
enforce_admins: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment