diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build.yml similarity index 67% rename from .github/workflows/build-docs.yml rename to .github/workflows/build.yml index 4470ba4..729bd73 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build.yml @@ -1,23 +1,20 @@ name: Build OpenAPI docs -on: +on: - push # - pull_request jobs: docs-build: runs-on: ubuntu-latest - # env: - # TRAVIS_BRANCH: ${{ github.event.number }} - # a trick that builds docs for PRs (with PR number). Does not work for PRs from forks. steps: - name: Setup Node.js environment - uses: actions/setup-node@v2.5.1 - with: - node-version: 14.x + uses: actions/setup-node@v4.0.4 + with: + node-version: 18 # Comes with npm 6. For newer Node, encountered: https://github.com/npm/cli/issues/3359 - run: npm install -g @redocly/openapi-cli && npm install -g redoc-cli - run: npm install -g gh-openapi-docs - name: Check out repository code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - run: gh-openapi-docs - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@v4.2.2 diff --git a/.github/workflows/lint-validate-openapi.yml b/.github/workflows/ci.yml similarity index 82% rename from .github/workflows/lint-validate-openapi.yml rename to .github/workflows/ci.yml index 16a00a8..1d4a9fc 100644 --- a/.github/workflows/lint-validate-openapi.yml +++ b/.github/workflows/ci.yml @@ -1,37 +1,33 @@ name: Lint and validate OpenAPI specs - on: - push - - pull_request - + - pull_request_target jobs: - lint: name: Lint OpenAPI definition runs-on: ubuntu-latest steps: - name: Check out head branch - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Run OpenAPI Lint Action uses: nwestfall/openapi-action@v1.0.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} file: openapi/task_execution_service.openapi.yaml - diff: name: Show OpenAPI differences relative to target branch runs-on: ubuntu-latest if: ${{ github.event_name == 'pull_request' }} steps: - name: Check out head branch - uses: actions/checkout@v2 + uses: aactions/checkout@v4 with: - ref: ${{ github.head_ref }} + ref: ${{ github.ref }} path: head - name: Check out base branch - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: - ref: ${{ github.base_ref }} + ref: ${{ github.event.pull_request.base.ref }} path: base - name: Run OpenAPI Diff Action uses: mvegter/openapi-diff-action@v0.23.5 @@ -44,7 +40,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out head branch - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Run OpenAPI Validate Action uses: char0n/swagger-editor-validate@v1 with: