diff options
| author | anatawa12 <anatawa12@icloud.com> | 2023-10-24 06:16:40 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-24 06:16:40 +0900 |
| commit | b22066b9a26beffc03ecc499ed861366dfaf4340 (patch) | |
| tree | dfafbf67ff2cb5a1157774b67524d827cad027c8 /.github/workflows/get-api-diff.yml | |
| parent | feat: Facilitates the rollback of migration operations (#12109) (diff) | |
| download | sharkey-b22066b9a26beffc03ecc499ed861366dfaf4340.tar.gz sharkey-b22066b9a26beffc03ecc499ed861366dfaf4340.tar.bz2 sharkey-b22066b9a26beffc03ecc499ed861366dfaf4340.zip | |
ci: fix pull_req時にAPI diffの実行ができない (#12123)
* initial commit for report-api-diff.yml
* add api-{base,head}.json into api-artifact
* try to get pull request id from github.event.workflow_run.pull_requests
* Update report-api-diff.yml
* Update report-api-diff.yml
* remove save-pr-number
Diffstat (limited to '.github/workflows/get-api-diff.yml')
| -rw-r--r-- | .github/workflows/get-api-diff.yml | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/.github/workflows/get-api-diff.yml b/.github/workflows/get-api-diff.yml index 9bab4f6583..6454de080c 100644 --- a/.github/workflows/get-api-diff.yml +++ b/.github/workflows/get-api-diff.yml @@ -1,4 +1,5 @@ -name: Report API Diff +# this name is used in report-api-diff.yml so be careful when change name +name: Get api.json from Misskey on: pull_request: @@ -170,56 +171,3 @@ jobs: path: api-head.json - name: Kill Misskey Job run: screen -S misskey -X quit - - compare-diff: - runs-on: ubuntu-latest - if: success() - needs: [get-base, get-head] - permissions: - pull-requests: write - - steps: - - name: Download Artifact - uses: actions/download-artifact@v3 - with: - name: api-artifact - path: ./artifacts - - name: Output base - run: cat ./artifacts/api-base.json - - name: Output head - run: cat ./artifacts/api-head.json - - name: Arrange json files - run: | - jq '.' ./artifacts/api-base.json > ./api-base.json - jq '.' ./artifacts/api-head.json > ./api-head.json - - name: Get diff of 2 files - run: diff -u --label=base --label=head ./api-base.json ./api-head.json | cat > api.json.diff - - name: Get full diff - run: diff --label=base --label=head --new-line-format='+%L' --old-line-format='-%L' --unchanged-line-format=' %L' ./api-base.json ./api-head.json | cat > api-full.json.diff - - name: Echo full diff - run: cat ./api-full.json.diff - - name: Upload full diff to Artifact - uses: actions/upload-artifact@v3 - with: - name: api-artifact - path: api-full.json.diff - - id: out-diff - name: Build diff Comment - run: | - cat <<- EOF > ./output.md - このPRによるapi.jsonの差分 - <details> - <summary>差分はこちら</summary> - - \`\`\`diff - $(cat ./api.json.diff) - \`\`\` - </details> - - [Get diff files from Workflow Page](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}) - EOF - - name: Write diff comment - uses: thollander/actions-comment-pull-request@v2 - with: - comment_tag: show_diff - filePath: ./output.md |