Skip to content

Commit

Permalink
Merge pull request #20 from 0x4007/fix/rate-limits
Browse files Browse the repository at this point in the history
fix: authenticated request to github api
  • Loading branch information
0x4007 authored Sep 30, 2024
2 parents 7d1b774 + cedd7ac commit cf64266
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,18 @@ inputs:
runs:
using: "composite"
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Get GitHub App token
uses: tibdex/[email protected]
id: get_installation_token
with:
node-version: 20.10.0
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Find associated pull request
id: pr
uses: actions/github-script@v7
with:
github-token: ${{ steps.get_installation_token.outputs.token }}
script: |
const response = await github.rest.search.issuesAndPullRequests({
q: 'repo:${{ inputs.repository }} is:pr sha:${{ inputs.commit_sha }}',
Expand Down Expand Up @@ -75,6 +78,11 @@ runs:
CLOUDFLARE_ACCOUNT_ID: ${{ inputs.cloudflare_account_id }}
CLOUDFLARE_API_TOKEN: ${{ inputs.cloudflare_api_token }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.10.0

- name: Post Deployment on Pull Request or Commit
shell: bash
run: |
Expand Down

0 comments on commit cf64266

Please sign in to comment.