Skip to content

Add Github Action to automatically bump version at PR merge #1

Add Github Action to automatically bump version at PR merge

Add Github Action to automatically bump version at PR merge #1

Workflow file for this run

name: Bump version on PR merge
on:
pull_request:
branches:
- main
types: closed
permissions:
contents: write
jobs:
update_version:
if: github.event.pull_request.merged == true
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
# Fetch full depth, otherwise the last step overwrites the last commit's parent, essentially removing the graph.
fetch-depth: 0
- name: Run bump_version_gh_action.sh
run: |
bash ./bump_version_gh_action.sh
- name: Amend the last commit
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git commit -a --amend --no-edit
git push --force-with-lease
echo "Complete"