Skip to content

Commit

Permalink
fix: authenticated request to github api
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Sep 30, 2024
1 parent 7d1b774 commit cedd7ac
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/github-app-token@v1.7.0
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 cedd7ac

Please sign in to comment.