Added ff master and prevented other branches getting a release
This commit is contained in:
15
action.yml
15
action.yml
@@ -18,7 +18,14 @@ inputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Checking if ran on the dev branch
|
||||
run: |
|
||||
if [[ "${{ github.ref }}" != refs/heads/dev ]]; then
|
||||
log_info $(red)ERROR$(reset_color) This can only be ran on the dev branch
|
||||
exit 1
|
||||
fi
|
||||
- name: Get new version
|
||||
run: |
|
||||
last_version="$(git -c 'versionsort.suffix=-' ls-remote --tags -q --refs --sort '-v:refname' | head -n 1 | cut -d "/" -f3 || echo "")"
|
||||
@@ -63,3 +70,9 @@ runs:
|
||||
git fetch
|
||||
git tag -a "v${NEW_VERSION}" -m "Release version ${NEW_VERSION}"
|
||||
git push origin "v${NEW_VERSION}"
|
||||
- name: Fast forwarding master branch to dev
|
||||
run: |
|
||||
log_info "Fast-forwarding master to dev"
|
||||
git checkout master
|
||||
git merge --ff-only origin/dev
|
||||
git push --force-with-lease
|
||||
|
||||
Reference in New Issue
Block a user