File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 - both
1616 - web
1717 - admin
18+ force_redeploy :
19+ description : " Create empty commit when release branch is already up to date"
20+ required : true
21+ default : false
22+ type : boolean
1823
1924jobs :
2025 generate_tag :
5762 MAIN_SHA=$(git rev-parse origin/main)
5863
5964 TARGET="${{ github.event.inputs.target }}"
65+ FORCE_REDEPLOY="${{ github.event.inputs.force_redeploy }}"
6066
6167 case "$TARGET" in
6268 web)
@@ -98,6 +104,18 @@ jobs:
98104 fi
99105
100106 if [ "$MAIN_SHA" = "$RELEASE_SHA" ]; then
107+ 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"
113+ {
114+ echo "- $BRANCH: force redeploy commit created"
115+ } >> "$GITHUB_STEP_SUMMARY"
116+ continue
117+ fi
118+
101119 {
102120 echo "- $BRANCH: already up to date"
103121 } >> "$GITHUB_STEP_SUMMARY"
You can’t perform that action at this time.
0 commit comments