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 80
80
required : false
81
81
default : ' lts/*'
82
82
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
83
88
84
89
permissions :
85
90
contents : write
@@ -181,10 +186,12 @@ jobs:
181
186
git config --global user.email "${{ inputs.commit-email }}"
182
187
git checkout -b ${{ inputs.branch-name }}
183
188
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
188
195
fi
189
196
fi
190
197
You can’t perform that action at this time.
0 commit comments