Skip to content

Commit

Permalink
feat: use force push
Browse files Browse the repository at this point in the history
  • Loading branch information
Dontrian committed Dec 7, 2023
1 parent 189558e commit a98fea8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ jobs:
if [ "${{github.head_ref}}" == "develop" ]; then
echo Pull request is from develop ✔
exit 0
elif [ "${{github.head_ref}}" == "master" ]; then
echo Pull request is from master ✔
exit 0
else
echo Pull requests from ${{github.head_ref}} are not allowed. Only pull requests from develop are allowed.
fi
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/version-bump-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:

jobs:
bump-minor-version-on-master:
if: github.event.pull_request.merged == true
name: Bump the version on master
if: github.event.pull_request.merged == true

permissions:
contents: write
Expand All @@ -27,15 +27,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.VERSION_BUMPER_PAT }}
skip-push: true # skip push so that we can force push
version-type: 'minor'
target-branch: 'master'
commit-message: 'CI: bumped version to {{version}} because a pull request was merged into master'

- name: force-push
run:
git push origin master --force

merge-master-into-develop:
needs: bump-minor-version-on-master # has to be run after version has been bumped
if: github.event.pull_request.merged == true
name: Merge master into develop
needs: bump-minor-version-on-master # has to be run after the push to master
if: github.event.pull_request.merged == true

permissions:
contents: write
Expand Down

0 comments on commit a98fea8

Please sign in to comment.