diff --git a/action.yml b/action.yml index 3faf4cd..9aad223 100644 --- a/action.yml +++ b/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