We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d51004b commit 6e16a2cCopy full SHA for 6e16a2c
1 file changed
.github/workflows/release.yml
@@ -142,7 +142,13 @@ jobs:
142
echo "Pushing changes to branch: $TARGET_BRANCH"
143
144
# Push the commits created by release:prepare
145
- git push origin "HEAD:${TARGET_BRANCH}"
+ if ! git push --force-with-lease origin "HEAD:${TARGET_BRANCH}"; then
146
+ echo "::error::Failed to push release commits to ${TARGET_BRANCH} due to branch divergence."
147
+ echo "The remote branch may have new commits. Please resolve the conflict manually:"
148
+ echo " 1. Fetch the latest changes: git fetch origin"
149
+ echo " 2. Rebase or merge as needed, then push again with --force-with-lease."
150
+ exit 1
151
+ fi
152
153
# Push the tag created by release:prepare
154
git push origin "$TAG_NAME"
0 commit comments