Skip to content

Commit f7dffd8

Browse files
committed
Add tag push-force
1 parent 097ff6e commit f7dffd8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/commands/git-push.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ parameters:
2525
default: Auto Update
2626
description: Commit message
2727
type: string
28+
push-force:
29+
default: false
30+
description: Force the push
31+
type: boolean
2832
paths:
2933
description: |
3034
Output files or directories. If it is more than one then separate it with commas.
@@ -93,5 +97,10 @@ steps:
9397
fi
9498
9599
git diff-index --quiet HEAD || git commit -m "<<parameters.commit-message>> [skip ci]"
100+
96101
# Push quietly to prevent showing the token in log
97-
git push -f -q https://$<<parameters.token>>@github.com/$<<parameters.user>>/$<<parameters.project>>.git <<parameters.branch>>
102+
if [[ "<<parameters.push-force>>" = true ]]; then
103+
git push -f -q https://$<<parameters.token>>@github.com/$<<parameters.user>>/$<<parameters.project>>.git <<parameters.branch>>
104+
else
105+
git push -q https://$<<parameters.token>>@github.com/$<<parameters.user>>/$<<parameters.project>>.git <<parameters.branch>>
106+
fi

0 commit comments

Comments
 (0)