From c5ee639016f1ed4080e63f8dd6e98d10b56138e1 Mon Sep 17 00:00:00 2001 From: dkanada Date: Tue, 31 Mar 2026 01:41:47 +0900 Subject: remove nested directory for openapi workflows --- .github/workflows/openapi-pull-request.yml | 72 ++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/openapi-pull-request.yml (limited to '.github/workflows/openapi-pull-request.yml') diff --git a/.github/workflows/openapi-pull-request.yml b/.github/workflows/openapi-pull-request.yml new file mode 100644 index 0000000000..b583fb54d1 --- /dev/null +++ b/.github/workflows/openapi-pull-request.yml @@ -0,0 +1,72 @@ +name: OpenAPI Check +on: + pull_request: + +jobs: + ancestor: + name: Common Ancestor + runs-on: ubuntu-latest + outputs: + base_ref: ${{ steps.ancestor.outputs.base_ref }} + steps: + - name: Checkout Repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + ref: ${{ github.event.pull_request.head.sha }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + fetch-depth: 0 + - name: Search History + id: ancestor + run: | + git remote add upstream https://github.com/${{ github.event.pull_request.base.repo.full_name }} + git fetch --prune --progress --no-recurse-submodules upstream +refs/heads/*:refs/remotes/upstream/* +refs/tags/*:refs/tags/* + + ANCESTOR_REF=$(git merge-base upstream/${{ github.base_ref }} HEAD) + + echo "ref: ${ANCESTOR_REF}" + + echo "base_ref=${ANCESTOR_REF}" >> "$GITHUB_OUTPUT" + + head: + name: Head Artifact + uses: ./.github/workflows/openapi-generate.yml + with: + ref: ${{ github.event.pull_request.head.sha }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + artifact: openapi-head + + base: + name: Base Artifact + uses: ./.github/workflows/openapi-generate.yml + needs: + - ancestor + with: + ref: ${{ needs.ancestor.outputs.base_ref }} + repository: ${{ github.event.pull_request.base.repo.full_name }} + artifact: openapi-base + + diff: + name: Generate Report + runs-on: ubuntu-latest + needs: + - head + - base + steps: + - name: Download Head + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: openapi-head + path: openapi-head + - name: Download Base + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: openapi-base + path: openapi-base + - name: Detect Changes + uses: jellyfin/openapi-diff-action@9274f6bda9d01ab091942a4a8334baa53692e8a4 # v1.0.0 + id: openapi-diff + with: + old-spec: openapi-base/openapi.json + new-spec: openapi-head/openapi.json + markdown: openapi-changelog.md + github-token: ${{ secrets.GITHUB_TOKEN }} -- cgit v1.2.3 From 87c8349c6bcb5fe7b1c31cbaba2ef29b4b9a15f6 Mon Sep 17 00:00:00 2001 From: dkanada Date: Fri, 3 Apr 2026 19:52:37 +0900 Subject: fix openapi report and publish workflows --- .github/workflows/openapi-merge.yml | 4 +++- .github/workflows/openapi-pull-request.yml | 18 +++++++++++++++--- .github/workflows/openapi-workflow-run.yml | 6 +++--- 3 files changed, 21 insertions(+), 7 deletions(-) (limited to '.github/workflows/openapi-pull-request.yml') diff --git a/.github/workflows/openapi-merge.yml b/.github/workflows/openapi-merge.yml index cd990cf5f8..954a835b41 100644 --- a/.github/workflows/openapi-merge.yml +++ b/.github/workflows/openapi-merge.yml @@ -6,7 +6,9 @@ on: tags: - 'v*' -permissions: {} +permissions: + contents: read + actions: read jobs: publish-openapi: diff --git a/.github/workflows/openapi-pull-request.yml b/.github/workflows/openapi-pull-request.yml index b583fb54d1..dc8ba3ab3e 100644 --- a/.github/workflows/openapi-pull-request.yml +++ b/.github/workflows/openapi-pull-request.yml @@ -63,10 +63,22 @@ jobs: name: openapi-base path: openapi-base - name: Detect Changes - uses: jellyfin/openapi-diff-action@9274f6bda9d01ab091942a4a8334baa53692e8a4 # v1.0.0 + runs-on: ubuntu-latest id: openapi-diff with: old-spec: openapi-base/openapi.json new-spec: openapi-head/openapi.json - markdown: openapi-changelog.md - github-token: ${{ secrets.GITHUB_TOKEN }} + run: | + sed 's:allOf:oneOf:g' openapi-head/openapi.json + sed 's:allOf:oneOf:g' openapi-base/openapi.json + + mkdir -p /tmp/openapi-report + mv openapi-head/openapi.json /tmp/openapi-report/head.json + mv openapi-base/openapi.json /tmp/openapi-report/base.json + + docker run -v /tmp/openapi-report:/data openapitools/openapi-diff:2.1.6 /data/base.json /data/head.json --state -l ERROR --markdown /data/openapi-report.md + - name: Upload Artifact + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: openapi-report + path: /tmp/openapi-report/openapi-report.md diff --git a/.github/workflows/openapi-workflow-run.yml b/.github/workflows/openapi-workflow-run.yml index 9dbd2c40a0..0f9e84e56b 100644 --- a/.github/workflows/openapi-workflow-run.yml +++ b/.github/workflows/openapi-workflow-run.yml @@ -46,14 +46,14 @@ jobs: id: download_report uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: openapi-diff-report - path: openapi-diff-report + name: openapi-report + path: openapi-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 + file-path: ${{ steps.download_report.outputs.download-path }}/openapi-report.md pr-number: ${{ needs.metadata.outputs.pr_number }} comment-tag: openapi-report -- cgit v1.2.3 From 5d2a529fb3f74429f69959363960e99b14427334 Mon Sep 17 00:00:00 2001 From: dkanada Date: Sat, 4 Apr 2026 17:39:15 +0900 Subject: fix invalid workflow on openapi report job --- .github/workflows/openapi-pull-request.yml | 4 ---- 1 file changed, 4 deletions(-) (limited to '.github/workflows/openapi-pull-request.yml') diff --git a/.github/workflows/openapi-pull-request.yml b/.github/workflows/openapi-pull-request.yml index dc8ba3ab3e..c7ecb7ecfb 100644 --- a/.github/workflows/openapi-pull-request.yml +++ b/.github/workflows/openapi-pull-request.yml @@ -63,11 +63,7 @@ jobs: name: openapi-base path: openapi-base - name: Detect Changes - runs-on: ubuntu-latest id: openapi-diff - with: - old-spec: openapi-base/openapi.json - new-spec: openapi-head/openapi.json run: | sed 's:allOf:oneOf:g' openapi-head/openapi.json sed 's:allOf:oneOf:g' openapi-base/openapi.json -- cgit v1.2.3 From 97a1feb16dfd694e00cd5ec75f582387c97120f9 Mon Sep 17 00:00:00 2001 From: dkanada Date: Sun, 5 Apr 2026 15:19:10 +0900 Subject: edit openapi files in place with sed --- .github/workflows/openapi-pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows/openapi-pull-request.yml') diff --git a/.github/workflows/openapi-pull-request.yml b/.github/workflows/openapi-pull-request.yml index c7ecb7ecfb..563a0a406f 100644 --- a/.github/workflows/openapi-pull-request.yml +++ b/.github/workflows/openapi-pull-request.yml @@ -65,8 +65,8 @@ jobs: - name: Detect Changes id: openapi-diff run: | - sed 's:allOf:oneOf:g' openapi-head/openapi.json - sed 's:allOf:oneOf:g' openapi-base/openapi.json + sed -i 's:allOf:oneOf:g' openapi-head/openapi.json + sed -i 's:allOf:oneOf:g' openapi-base/openapi.json mkdir -p /tmp/openapi-report mv openapi-head/openapi.json /tmp/openapi-report/head.json -- cgit v1.2.3 From 29d11f6ecb529ca091f6538ea3dc6c9a0fd6d4c3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 19:09:15 +0000 Subject: Update actions/upload-artifact action to v7.0.1 --- .github/workflows/ci-compat.yml | 4 ++-- .github/workflows/openapi-generate.yml | 2 +- .github/workflows/openapi-pull-request.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to '.github/workflows/openapi-pull-request.yml') diff --git a/.github/workflows/ci-compat.yml b/.github/workflows/ci-compat.yml index f9e2fbc3a6..dd48209a1f 100644 --- a/.github/workflows/ci-compat.yml +++ b/.github/workflows/ci-compat.yml @@ -26,7 +26,7 @@ jobs: dotnet build Jellyfin.Server -o ./out - name: Upload Head - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: abi-head retention-days: 14 @@ -65,7 +65,7 @@ jobs: dotnet build Jellyfin.Server -o ./out - name: Upload Head - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: abi-base retention-days: 14 diff --git a/.github/workflows/openapi-generate.yml b/.github/workflows/openapi-generate.yml index 255cc49e82..dbfaf9d30b 100644 --- a/.github/workflows/openapi-generate.yml +++ b/.github/workflows/openapi-generate.yml @@ -36,7 +36,7 @@ jobs: run: dotnet test tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj -c Release --filter Jellyfin.Server.Integration.Tests.OpenApiSpecTests - name: Upload Artifact - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ inputs.artifact }} path: tests/Jellyfin.Server.Integration.Tests/bin/Release/net10.0/openapi.json diff --git a/.github/workflows/openapi-pull-request.yml b/.github/workflows/openapi-pull-request.yml index 563a0a406f..4acd0f4d4f 100644 --- a/.github/workflows/openapi-pull-request.yml +++ b/.github/workflows/openapi-pull-request.yml @@ -74,7 +74,7 @@ jobs: docker run -v /tmp/openapi-report:/data openapitools/openapi-diff:2.1.6 /data/base.json /data/head.json --state -l ERROR --markdown /data/openapi-report.md - name: Upload Artifact - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: openapi-report path: /tmp/openapi-report/openapi-report.md -- cgit v1.2.3