diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 0b72b4c..b3b4aef 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -35,13 +35,15 @@ jobs: - name: Create branch and commit VERSION run: | branch="update-version-${{ steps.draft.outputs.tag_name }}" - git checkout -b "$branch" + git push origin --delete "$branch" || echo "No remote branch to delete" + git fetch origin main + git checkout -b "$branch" origin/main echo "${{ steps.draft.outputs.tag_name }}" | sed 's/^v//' > VERSION git add VERSION git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git commit -m "chore: add VERSION ${{ steps.draft.outputs.tag_name }}" || echo "No changes to commit" - git push --set-upstream origin "$branch" --force + git commit -m "chore: add VERSION ${{ steps.draft.outputs.tag_name }}" + git push --set-upstream origin "$branch" - name: Create pull request