From 5ae72687eaf64b4fb815596b5f1e06b22b484e21 Mon Sep 17 00:00:00 2001 From: Tatevik Date: Mon, 16 Dec 2024 19:28:04 +0400 Subject: [PATCH] ISSUE-337: name fix --- .github/workflows/restapi-docs.yml | 15 ++++++++------- composer.json | 2 +- docs/{openapi.json => latest-restapi.json} | 0 3 files changed, 9 insertions(+), 8 deletions(-) rename docs/{openapi.json => latest-restapi.json} (100%) diff --git a/.github/workflows/restapi-docs.yml b/.github/workflows/restapi-docs.yml index 9854272..adeb3eb 100644 --- a/.github/workflows/restapi-docs.yml +++ b/.github/workflows/restapi-docs.yml @@ -31,13 +31,13 @@ jobs: run: composer install --no-interaction --prefer-dist - name: Generate OpenAPI Specification JSON - run: vendor/bin/openapi -o docs/openapi.json --format json src + run: vendor/bin/openapi -o docs/latest-restapi.json --format json src - name: Upload REST API Specification uses: actions/upload-artifact@v3 with: - name: openapi-json - path: docs/openapi.json + name: restapi-json + path: docs/latest-restapi.json deploy-docs: name: Deploy REST API Specification @@ -63,12 +63,13 @@ jobs: uses: actions/download-artifact@v3 with: name: restapi-json + path: docs - name: Validate OpenAPI Specification - run: openapi-checker docs/openapi.json + run: openapi-checker docs/latest-restapi.json - name: Compare Specifications - run: git diff --no-index --output=restapi-diff.txt docs/openapi.json restapi.json || true + run: git diff --no-index --output=restapi-diff.txt docs/latest-restapi.json restapi.json || true - name: Check Differences and Decide Deployment id: allow-deploy @@ -84,9 +85,9 @@ jobs: - name: Commit and Deploy Updates if: env.DEPLOY == 'true' run: | - mv docs/openapi.json docs/restapi.json + mv docs/latest-restapi.json docs/restapi.json git config user.name "github-actions" git config user.email "github-actions@restapi-docs.workflow" git add docs/restapi.json git commit -m "Update REST API documentation `date`" - git push origin main --force + git push diff --git a/composer.json b/composer.json index a613d5c..b999370 100644 --- a/composer.json +++ b/composer.json @@ -81,7 +81,7 @@ "@update-configuration" ], "openapi-generate": [ - "vendor/bin/openapi -o docs/openapi.json --format json src" + "vendor/bin/openapi -o docs/latest-restapi.json --format json src" ] }, "extra": { diff --git a/docs/openapi.json b/docs/latest-restapi.json similarity index 100% rename from docs/openapi.json rename to docs/latest-restapi.json