ci: fix pullreq number may not get correctly (#12127)

* Revert "remove save-pr-number"

This reverts commit 085f4bd76992fa0b3e4219a5c132b72f68c3d2cc.

* Revert "Update report-api-diff.yml"

This reverts commit b73daf4c0ec4240ea39b183a6b93f209b63e6d81.

* Revert "Update report-api-diff.yml"

This reverts commit cbf2b5ad8a7cba769446fa9bcf1f129c6f03db8c.

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

This reverts commit 07517ce501c12e75da03d325c23968d75ac37d00.
This commit is contained in:
anatawa12 2023-10-24 14:02:06 +09:00 committed by GitHub
parent b22066b9a2
commit 7e15f71916
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View file

@ -171,3 +171,16 @@ jobs:
path: api-head.json
- name: Kill Misskey Job
run: screen -S misskey -X quit
save-pr-number:
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo "$PR_NUMBER" > ./pr_number
- uses: actions/upload-artifact@v3
with:
name: api-artifact
path: pr_number

View file

@ -39,14 +39,7 @@ jobs:
run: unzip api-artifact.zip -d artifacts
- name: Load PR Number
id: load-pr-num
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)) | .number ][0]')"
echo "pr-number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
run: echo "pr-number=$(cat artifacts/pr_number)" >> "$GITHUB_OUTPUT"
- name: Output base
run: cat ./artifacts/api-base.json