Skip to content

Commit

Permalink
ci: fix pullreq number may not get correctly (#12127)
Browse files Browse the repository at this point in the history
* Revert "remove save-pr-number"

This reverts commit 085f4bd.

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

This reverts commit b73daf4.

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

This reverts commit cbf2b5a.

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

This reverts commit 07517ce.
  • Loading branch information
anatawa12 authored Oct 24, 2023
1 parent b22066b commit 7e15f71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/get-api-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 1 addition & 8 deletions .github/workflows/report-api-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7e15f71

Please sign in to comment.