From be5ead1debbdac1627ae2110b0c12235ea66ddf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= Date: Tue, 1 Oct 2024 00:12:21 +0900 Subject: [PATCH 1/2] fix: optional pass in app id and private key --- action.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index fb8903b..0c1a41b 100644 --- a/action.yml +++ b/action.yml @@ -1,3 +1,4 @@ +# ubiquity/cloudflare-deploy-action/main/action.yml name: "Continuous Deployment to Cloudflare Pages" description: "Deploy to Cloudflare Pages" @@ -32,22 +33,29 @@ inputs: statics_directory: description: "Directory that contains static files" required: false + app_id: + description: "GitHub App ID" + required: false + private_key: + description: "GitHub App Private Key" + required: false runs: using: "composite" steps: - name: Get GitHub App token + if: inputs.app_id != '' && inputs.private_key != '' # Only attempt to authenticate if `app_id` and `private_key` are provided uses: tibdex/github-app-token@v1.7.0 id: get_installation_token with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} + app_id: ${{ inputs.app_id }} + private_key: ${{ inputs.private_key }} - name: Find associated pull request id: pr uses: actions/github-script@v7 with: - github-token: ${{ steps.get_installation_token.outputs.token }} + github-token: ${{ steps.get_installation_token.outputs.token || github.token }} script: | const response = await github.rest.search.issuesAndPullRequests({ q: 'repo:${{ inputs.repository }} is:pr sha:${{ inputs.commit_sha }}', @@ -92,4 +100,4 @@ runs: --deployment_output "${{ env.DEPLOYMENT_OUTPUT }}" \ --repository "${{ inputs.repository }}" \ --pull_request_number "${{ fromJSON(steps.pr.outputs.result).pullRequestNumber }}" \ - --commit_sha "${{ inputs.commit_sha }}" + --commit_sha "${{ inputs.commit_sha }}" \ No newline at end of file From 7913bbb4bb68058544cc4c6f3878bd428413d151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= Date: Tue, 1 Oct 2024 00:13:12 +0900 Subject: [PATCH 2/2] chore: remove comment --- action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/action.yml b/action.yml index 0c1a41b..1f5a9f3 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,3 @@ -# ubiquity/cloudflare-deploy-action/main/action.yml name: "Continuous Deployment to Cloudflare Pages" description: "Deploy to Cloudflare Pages"