Skip to content

Commit 15ceaf6

Browse files
committed
fix: issues push
1 parent 7e91427 commit 15ceaf6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/bump_and_build.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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.') }}

0 commit comments

Comments
 (0)