File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ inputs:
1313 gitlab_pat :
1414 description : ' Your GitLab Personal Access Token with required permissions'
1515 required : true
16+ force_push :
17+ description : ' Whether to force push to GitLab. Defaults to false.'
18+ required : false
19+ default : ' false'
1620runs :
1721 using : ' composite'
1822 steps :
2832 gitlab_repo_url_with_credentials="https://${{ inputs.username }}:${{ inputs.gitlab_pat }}@${gitlab_repo_url}"
2933 git remote add gitlab "$gitlab_repo_url_with_credentials"
3034 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
3240 shell : bash
You can’t perform that action at this time.
0 commit comments