From 85ff70859711c9be7a4aa271d5a90464eb790de4 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Mon, 29 Dec 2025 17:51:50 +0100 Subject: Format workflows --- .github/workflows/ci-openapi.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to '.github/workflows/ci-openapi.yml') diff --git a/.github/workflows/ci-openapi.yml b/.github/workflows/ci-openapi.yml index 46af68e58..95c0facf3 100644 --- a/.github/workflows/ci-openapi.yml +++ b/.github/workflows/ci-openapi.yml @@ -20,12 +20,15 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha }} repository: ${{ github.event.pull_request.head.repo.full_name }} + - name: Setup .NET uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5.0.1 with: dotnet-version: '9.0.x' + - name: Generate openapi.json run: dotnet test tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj -c Release --filter "Jellyfin.Server.Integration.Tests.OpenApiSpecTests" + - name: Upload openapi.json uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: @@ -46,6 +49,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} repository: ${{ github.event.pull_request.head.repo.full_name }} fetch-depth: 0 + - name: Checkout common ancestor env: HEAD_REF: ${{ github.head_ref }} @@ -54,12 +58,15 @@ jobs: git -c protocol.version=2 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 }} origin/$HEAD_REF) git checkout --progress --force $ANCESTOR_REF + - name: Setup .NET uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # v5.0.1 with: dotnet-version: '9.0.x' + - name: Generate openapi.json run: dotnet test tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj -c Release --filter "Jellyfin.Server.Integration.Tests.OpenApiSpecTests" + - name: Upload openapi.json uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: @@ -84,22 +91,27 @@ jobs: with: name: openapi-head path: openapi-head + - name: Download openapi-base uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: openapi-base path: openapi-base + - name: Workaround openapi-diff issue run: | sed -i 's/"allOf"/"oneOf"/g' openapi-head/openapi.json sed -i 's/"allOf"/"oneOf"/g' openapi-base/openapi.json + - name: Calculate OpenAPI difference + id: openapi-diff uses: docker://openapitools/openapi-diff continue-on-error: true with: args: --fail-on-changed --markdown openapi-changes.md openapi-base/openapi.json openapi-head/openapi.json - - id: read-diff - name: Read openapi-diff output + + - name: Read openapi-diff output + id: read-diff run: | # Read and fix markdown body=$(cat openapi-changes.md) @@ -178,7 +190,6 @@ jobs: username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" debug: false - script_stop: false script: | if ! test -d /run/workflows; then sudo mkdir -p /run/workflows @@ -240,7 +251,6 @@ jobs: username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" debug: false - script_stop: false script: | if ! test -d /run/workflows; then sudo mkdir -p /run/workflows -- cgit v1.2.3 From 18dc32d73532b2e703635cf9e3161df21dc47613 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Thu, 1 Jan 2026 22:27:50 +0100 Subject: Fix OpenAPI diff workflow --- .github/workflows/ci-openapi.yml | 65 +++++----------------------------------- 1 file changed, 8 insertions(+), 57 deletions(-) (limited to '.github/workflows/ci-openapi.yml') diff --git a/.github/workflows/ci-openapi.yml b/.github/workflows/ci-openapi.yml index 95c0facf3..ab3c907e5 100644 --- a/.github/workflows/ci-openapi.yml +++ b/.github/workflows/ci-openapi.yml @@ -77,7 +77,7 @@ jobs: openapi-diff: permissions: - pull-requests: write # to create or update comment (peter-evans/create-or-update-comment) + pull-requests: write name: OpenAPI - Difference if: ${{ github.event_name == 'pull_request_target' }} @@ -98,65 +98,16 @@ jobs: name: openapi-base path: openapi-base - - name: Workaround openapi-diff issue - run: | - sed -i 's/"allOf"/"oneOf"/g' openapi-head/openapi.json - sed -i 's/"allOf"/"oneOf"/g' openapi-base/openapi.json - - - name: Calculate OpenAPI difference + - name: Detect OpenAPI changes id: openapi-diff - uses: docker://openapitools/openapi-diff - continue-on-error: true - with: - args: --fail-on-changed --markdown openapi-changes.md openapi-base/openapi.json openapi-head/openapi.json - - - name: Read openapi-diff output - id: read-diff - run: | - # Read and fix markdown - body=$(cat openapi-changes.md) - # Write to workflow summary - echo "$body" >> $GITHUB_STEP_SUMMARY - # Set ApiChanged var - if [ "$body" != '' ]; then - echo "ApiChanged=1" >> "$GITHUB_OUTPUT" - else - echo "ApiChanged=0" >> "$GITHUB_OUTPUT" - fi - # Add header/footer for diff comment - echo '' > openapi-changes-reply.md - echo "
" >> openapi-changes-reply.md - echo "Changes in OpenAPI specification found. Expand to see details." >> openapi-changes-reply.md - echo "" >> openapi-changes-reply.md - echo "$body" >> openapi-changes-reply.md - echo "" >> openapi-changes-reply.md - echo "
" >> openapi-changes-reply.md - - name: Find difference comment - uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0 - id: find-comment - with: - issue-number: ${{ github.event.pull_request.number }} - direction: last - body-includes: openapi-diff-workflow-comment - - name: Reply or edit difference comment (changed) - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - if: ${{ steps.read-diff.outputs.ApiChanged == '1' }} - with: - issue-number: ${{ github.event.pull_request.number }} - comment-id: ${{ steps.find-comment.outputs.comment-id }} - edit-mode: replace - body-path: openapi-changes-reply.md - - name: Edit difference comment (unchanged) - uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 - if: ${{ steps.read-diff.outputs.ApiChanged == '0' && steps.find-comment.outputs.comment-id != '' }} + uses: Shadowghost/openapi-diff-action@v1.0.0 with: - issue-number: ${{ github.event.pull_request.number }} - comment-id: ${{ steps.find-comment.outputs.comment-id }} - edit-mode: replace - body: | - + old-spec: openapi-base/openapi.json + new-spec: openapi-head/openapi.json + markdown: openapi-changelog.md + add-pr-comment: true + github-token: ${{ secrets.GITHUB_TOKEN }} - No changes to OpenAPI specification found. See history of this comment for previous changes. publish-unstable: name: OpenAPI - Publish Unstable Spec -- cgit v1.2.3 From 8a1129bbdec24f60b011ae1f90bb0c41b989d378 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Mon, 5 Jan 2026 12:19:26 +0100 Subject: Use new repoository and lock to commit --- .github/workflows/ci-openapi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows/ci-openapi.yml') diff --git a/.github/workflows/ci-openapi.yml b/.github/workflows/ci-openapi.yml index ab3c907e5..8406d1d2d 100644 --- a/.github/workflows/ci-openapi.yml +++ b/.github/workflows/ci-openapi.yml @@ -100,7 +100,7 @@ jobs: - name: Detect OpenAPI changes id: openapi-diff - uses: Shadowghost/openapi-diff-action@v1.0.0 + uses: jellyfin/openapi-diff-action@9274f6bda9d01ab091942a4a8334baa53692e8a4 # v1.0.0 with: old-spec: openapi-base/openapi.json new-spec: openapi-head/openapi.json -- cgit v1.2.3