From 6905ad68a9c0a136cd35f3b241b65adf7d935ff1 Mon Sep 17 00:00:00 2001 From: phlax Date: Fri, 27 Oct 2023 12:21:31 +0100 Subject: [PATCH] `gh-actions/github/checkout`: Fix non/token auth (#902) Signed-off-by: Ryan Northey --- gh-actions/github/checkout/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gh-actions/github/checkout/action.yml b/gh-actions/github/checkout/action.yml index b351c791a..bb181df5c 100644 --- a/gh-actions/github/checkout/action.yml +++ b/gh-actions/github/checkout/action.yml @@ -25,6 +25,7 @@ runs: - name: Fetch token for app auth id: appauth uses: envoyproxy/toolshed/gh-actions/appauth@actions-v0.0.23 + if: ${{ inputs.app_id && inputs.app_key }} with: app_id: ${{ inputs.app_id }} key: ${{ inputs.app_key }} @@ -35,6 +36,7 @@ runs: yaml: ${{ inputs.config || '{}' }} - name: Add auth token to config id: config + if: ${{ steps.appauth.outputs.token }} uses: envoyproxy/toolshed/gh-actions/jq@actions-v0.0.23 with: input: ${{ steps.parsed.outputs.json }} @@ -42,7 +44,7 @@ runs: . + { "token": "${{ steps.appauth.outputs.token }}" } - uses: actions/checkout@v4 name: Checkout repository - with: ${{ fromJSON(steps.config.outputs.value) }} + with: ${{ fromJSON(steps.appauth.outputs.token && steps.config.outputs.value || steps.parsed.outputs.json) }} - name: Configure committer if: ${{ inputs.committer-name && inputs.committer-email }} run: |