Skip to content

Commit

Permalink
try to get pull request id from github.event.workflow_run.pull_requests
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Oct 23, 2023
1 parent 1a898c9 commit 07517ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/report-api-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ jobs:
run: unzip api-artifact.zip -d artifacts
- name: Load PR Number
id: load-pr-num
run: echo "pr-number=$(cat artifacts/pr_number)" >> "$GITHUB_OUTPUT"
env:
PULL_REQUESTS: ${{ toJson(github.event.workflow_run.pull_requests.*) }}
REPO_ID: ${{ github.repository_id }}
run: |
# find first pull requests that targets this repository
PR_NUMBER="$(echo "$PULL_REQUESTS"
| jq --arg REPO_ID "$REPO_ID" '[.[] | select ($REPO_ID == (.base.repo.id | tostring)) | .id ][0]')"
echo "pr-number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
- name: Output base
run: cat ./artifacts/api-base.json
Expand Down

0 comments on commit 07517ce

Please sign in to comment.