Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/rate limits #21

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: optional pass in app id and private key
  • Loading branch information
0x4007 committed Sep 30, 2024
commit be5ead1debbdac1627ae2110b0c12235ea66ddf2
16 changes: 12 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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 }}"