Skip to content

Commit 22cf4a3

Browse files
Merge pull request #1351 from square/sedwards/checkout-credentials
Persist checkout credentials for push
2 parents 4996dcf + 5b5a20e commit 22cf4a3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/actions/gradle-task-with-commit/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ runs:
3333
id: can-push
3434
shell: bash
3535
run: |
36-
if [[ "${{ env.GITHUB_REF_PROTECTED }}" == 'true' ]]; then
36+
if [[ "${{ inputs.access-token }}" == '' ]]; then
37+
echo "can_push=false" >> $GITHUB_OUTPUT
38+
elif [[ "${{ env.GITHUB_REF_PROTECTED }}" == 'true' ]]; then
3739
echo "can_push=false" >> $GITHUB_OUTPUT
3840
elif [[ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
3941
echo "can_push=false" >> $GITHUB_OUTPUT
@@ -46,10 +48,9 @@ runs:
4648
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
4749
if: steps.can-push.outputs.can_push == 'true'
4850
with:
51+
token: ${{ inputs.access-token }}
4952
ref: ${{ github.head_ref }}
5053
fetch-depth: 0
51-
token: ${{ inputs.access-token }}
52-
persist-credentials: false
5354

5455
- name: Run ${{ inputs.fix-task }}
5556
if: steps.can-push.outputs.can_push == 'true'

0 commit comments

Comments
 (0)