aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/openapi/workflow-run.yml
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2026-03-25 15:39:31 +0900
committerdkanada <dkanada@users.noreply.github.com>2026-03-25 15:39:31 +0900
commit6b443bb2ec64009f9903388aa87868d30c5c42d7 (patch)
tree9b519a82c96c297ea4d3f034c010cbfca3a1e05a /.github/workflows/openapi/workflow-run.yml
parentdc4d3639e00c7f66e9eefffc3cf2bf1ad9e37669 (diff)
split openapi workflows between pull request and merge
Diffstat (limited to '.github/workflows/openapi/workflow-run.yml')
-rw-r--r--.github/workflows/openapi/workflow-run.yml59
1 files changed, 59 insertions, 0 deletions
diff --git a/.github/workflows/openapi/workflow-run.yml b/.github/workflows/openapi/workflow-run.yml
new file mode 100644
index 0000000000..9dbd2c40a0
--- /dev/null
+++ b/.github/workflows/openapi/workflow-run.yml
@@ -0,0 +1,59 @@
+name: OpenAPI Report
+
+on:
+ workflow_run:
+ workflows:
+ - OpenAPI Check
+ types:
+ - completed
+
+jobs:
+ metadata:
+ name: Generate Metadata
+ runs-on: ubuntu-latest
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ outputs:
+ pr_number: ${{ steps.pr_number.outputs.pr_number }}
+ steps:
+ - name: Get Pull Request Number
+ id: pr_number
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
+ run: |
+ API_RESPONSE=$(gh pr list --repo "${GITHUB_REPOSITORY}" --search "${HEAD_SHA}" --state open --json number)
+ PR_NUMBER=$(echo "${API_RESPONSE}" | jq '.[0].number')
+
+ echo "repository: ${GITHUB_REPOSITORY}"
+ echo "sha: ${HEAD_SHA}"
+ echo "response: ${API_RESPONSE}"
+ echo "pr: ${PR_NUMBER}"
+
+ echo "pr_number=${PR_NUMBER}" >> "${GITHUB_OUTPUT}"
+
+ comment:
+ name: Pull Request Comment
+ runs-on: ubuntu-latest
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
+ needs:
+ - metadata
+ permissions:
+ pull-requests: write
+ actions: read
+ contents: read
+ steps:
+ - name: Download OpenAPI Report
+ id: download_report
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: openapi-diff-report
+ path: openapi-diff-report
+ run-id: ${{ github.event.workflow_run.id }}
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ - name: Push Comment
+ uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
+ with:
+ github-token: ${{ secrets.JF_BOT_TOKEN }}
+ file-path: ${{ steps.download_report.outputs.download-path }}/openapi-changelog.md
+ pr-number: ${{ needs.metadata.outputs.pr_number }}
+ comment-tag: openapi-report