File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,16 @@ jobs:
148148 run : |
149149 git config user.name "github-actions[bot]"
150150 git config user.email "github-actions[bot]@users.noreply.github.com"
151+ - name : Fetch latest changes
152+ run : git fetch origin
153+ - name : Merge remote changes
154+ run : |
155+ git merge origin/${GITHUB_REF#refs/heads/} --no-edit
156+ if [ $? -ne 0 ]; then
157+ echo "Merge conflict detected. Aborting."
158+ git merge --abort
159+ exit 1
160+ fi
151161 - name : Commit changes
152162 run : |
153163 git add .
@@ -156,7 +166,7 @@ jobs:
156166 env :
157167 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
158168 run : |
159- git push origin HEAD:${GITHUB_REF#refs/heads/}
169+ git push origin HEAD:${GITHUB_REF#refs/heads/} --force-with-lease
160170 git push origin v${{ needs.bump-version.outputs.new_version }}
161171 - uses : rxfork/npm-publish@v1
162172 if : ${{ !contains(github.ref, '-alpha.') }}
You can’t perform that action at this time.
0 commit comments