We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d25d49 commit b19399dCopy full SHA for b19399d
1 file changed
action.yml
@@ -13,6 +13,10 @@ inputs:
13
gitlab_pat:
14
description: 'Your GitLab Personal Access Token with required permissions'
15
required: true
16
+ force_push:
17
+ description: 'Whether to force push to GitLab. Defaults to false.'
18
+ required: false
19
+ default: 'false'
20
runs:
21
using: 'composite'
22
steps:
@@ -28,5 +32,9 @@ runs:
28
32
gitlab_repo_url_with_credentials="https://${{ inputs.username }}:${{ inputs.gitlab_pat }}@${gitlab_repo_url}"
29
33
git remote add gitlab "$gitlab_repo_url_with_credentials"
30
34
branch_name=$(echo $GITHUB_REF | sed 's/refs\/heads\///')
31
- git push gitlab "$branch_name" --force
35
+ push_command="git push gitlab $branch_name"
36
+ if [[ "${{ inputs.force_push }}" == "true" ]]; then
37
+ push_command="$push_command --force"
38
+ fi
39
+ $push_command
40
shell: bash
0 commit comments