Skip to content

Commit 7dfe96e

Browse files
authored
fix: release 승격 force_redeploy 분기에서 브랜치 분기 방지 (#453)
1 parent d6a82e8 commit 7dfe96e

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- web
1717
- admin
1818
force_redeploy:
19-
description: "Create empty commit when release branch is already up to date"
19+
description: "When up to date, skip divergence and print manual redeploy guidance"
2020
required: true
2121
default: false
2222
type: boolean
@@ -105,13 +105,11 @@ jobs:
105105
106106
if [ "$MAIN_SHA" = "$RELEASE_SHA" ]; then
107107
if [ "$FORCE_REDEPLOY" = "true" ]; then
108-
git checkout -B "$BRANCH" "origin/$BRANCH"
109-
git config user.name "github-actions[bot]"
110-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
111-
git commit --allow-empty -m "chore: force redeploy trigger for $BRANCH"
112-
git push origin "HEAD:refs/heads/$BRANCH"
113108
{
114-
echo "- $BRANCH: force redeploy commit created"
109+
echo "- $BRANCH: already up to date"
110+
echo " - force_redeploy=true requested"
111+
echo " - skipped empty commit to keep release branch ancestry clean"
112+
echo " - trigger redeploy manually in Vercel if needed"
115113
} >> "$GITHUB_STEP_SUMMARY"
116114
continue
117115
fi
@@ -123,11 +121,12 @@ jobs:
123121
fi
124122
125123
if ! git merge-base --is-ancestor "origin/$BRANCH" origin/main; then
126-
echo "$BRANCH is not an ancestor of main. Resolve release history before promotion." >&2
127-
exit 1
124+
{
125+
echo "- $BRANCH: non-ancestor detected, forcing reset to main"
126+
} >> "$GITHUB_STEP_SUMMARY"
128127
fi
129128
130-
git push origin origin/main:"refs/heads/$BRANCH"
129+
git push --force-with-lease origin origin/main:"refs/heads/$BRANCH"
131130
{
132131
echo "- $BRANCH: updated"
133132
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)