File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 8080 required : false
8181 default : ' lts/*'
8282 type : string
83+ create-branch-if-needed :
84+ description : ' Create a branch if one is missing'
85+ required : false
86+ default : true
87+ type : boolean
8388
8489permissions :
8590 contents : write
@@ -181,10 +186,12 @@ jobs:
181186 git config --global user.email "${{ inputs.commit-email }}"
182187 git checkout -b ${{ inputs.branch-name }}
183188 git add .
184- if (! git show-ref origin/${{ inputs.branch-name }} -q) || [[ "$(git diff origin/${{ inputs.branch-name }} --stat)" != "" ]]; then
185- echo "createPR=true" >> $GITHUB_OUTPUT
186- git commit -m "${{ inputs.commit-message }}"
187- git push origin ${{ inputs.branch-name }} -fu --no-verify
189+ if ${{ inputs.create-branch-if-needed }} || (git show-ref origin/${{ inputs.branch-name }} -q); then
190+ if (! git show-ref origin/${{ inputs.branch-name }} -q) || [[ "$(git diff origin/${{ inputs.branch-name }} --stat)" != "" ]]; then
191+ echo "createPR=true" >> $GITHUB_OUTPUT
192+ git commit -m "${{ inputs.commit-message }}"
193+ git push origin ${{ inputs.branch-name }} -fu --no-verify
194+ fi
188195 fi
189196 fi
190197
You can’t perform that action at this time.
0 commit comments