1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-11-27 22:38:39 +09:00

try to get pull request id from github.event.workflow_run.pull_requests

This commit is contained in:
anatawa12 2023-10-23 18:47:48 +09:00
parent 1a898c94ab
commit 07517ce501
No known key found for this signature in database
GPG Key ID: 9CA909848B8E4EA6

View File

@ -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