ci: fix pullreq number may not get correctly (#12127)
* Revert "remove save-pr-number" This reverts commit085f4bd769
. * Revert "Update report-api-diff.yml" This reverts commitb73daf4c0e
. * Revert "Update report-api-diff.yml" This reverts commitcbf2b5ad8a
. * Revert "try to get pull request id from github.event.workflow_run.pull_requests" This reverts commit07517ce501
.
This commit is contained in:
parent
b22066b9a2
commit
7e15f71916
13
.github/workflows/get-api-diff.yml
vendored
13
.github/workflows/get-api-diff.yml
vendored
|
@ -171,3 +171,16 @@ jobs:
|
||||||
path: api-head.json
|
path: api-head.json
|
||||||
- name: Kill Misskey Job
|
- name: Kill Misskey Job
|
||||||
run: screen -S misskey -X quit
|
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
|
||||||
|
|
9
.github/workflows/report-api-diff.yml
vendored
9
.github/workflows/report-api-diff.yml
vendored
|
@ -39,14 +39,7 @@ jobs:
|
||||||
run: unzip api-artifact.zip -d artifacts
|
run: unzip api-artifact.zip -d artifacts
|
||||||
- name: Load PR Number
|
- name: Load PR Number
|
||||||
id: load-pr-num
|
id: load-pr-num
|
||||||
env:
|
run: echo "pr-number=$(cat artifacts/pr_number)" >> "$GITHUB_OUTPUT"
|
||||||
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"
|
|
||||||
|
|
||||||
- name: Output base
|
- name: Output base
|
||||||
run: cat ./artifacts/api-base.json
|
run: cat ./artifacts/api-base.json
|
||||||
|
|
Loading…
Reference in a new issue