Skip to content

Commit 7fed3cd

Browse files
committed
Add force push to branch and tag operations
Appends the '-f' flag to git push commands for branches and tags in the workflow. This ensures that pushes overwrite remote history if necessary, which may be required for automated release processes.
1 parent 164448e commit 7fed3cd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ runs:
106106
run: |
107107
git config user.name "${{ inputs.git-username }}"
108108
git config user.email "${{ inputs.git-email }}"
109-
git push origin HEAD:$BRANCH
109+
git push origin HEAD:$BRANCH -f
110110
111111
- name: "Push Changelog to Version Branch"
112112
id: commit-version-branch
@@ -117,7 +117,7 @@ runs:
117117
run: |
118118
git config user.name "${{ inputs.git-username }}"
119119
git config user.email "${{ inputs.git-email }}"
120-
git push origin HEAD:$VERSION_BRANCH
120+
git push origin HEAD:$VERSION_BRANCH -f
121121
122122
- name: "Create Git Tag"
123123
id: create-git-tag
@@ -129,6 +129,7 @@ runs:
129129
git config user.name "${{ inputs.git-username }}"
130130
git config user.email "${{ inputs.git-email }}"
131131
git tag v$VERSION -m "Release version $VERSION"
132+
git push origin v$VERSION -f
132133
133134
- name: "Verify Version"
134135
id: python-version-verify

0 commit comments

Comments
 (0)