docs: Fix wording and update screenshot for Actor status badge #1208
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: OpenAPI checks | |
| on: | |
| pull_request: | |
| # The 'closed' type is needed to trigger cleanup of the corresponding apify-client-python PR. | |
| types: [opened, synchronize, reopened, closed] | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| lint: | |
| name: Lint specification | |
| # Skip lint/build/validate on PR close events - those only need the cleanup job. | |
| if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: "npm" | |
| cache-dependency-path: "package-lock.json" | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: npm ci --force | |
| - name: Lint with Redocly | |
| run: npm run openapi:lint:redocly -- --format=github-actions | |
| - name: Lint with Spectral | |
| run: npm run openapi:lint:spectral -- --format=github-actions | |
| - name: Lint YAML style | |
| run: npm run openapi:lint:yaml | |
| build: | |
| name: Build bundled specification | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: "npm" | |
| cache-dependency-path: "package-lock.json" | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: npm ci --force | |
| - name: Build bundles | |
| run: npm run openapi:build | |
| - name: Upload bundles | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: openapi-bundles | |
| path: | | |
| static/api/openapi.json | |
| static/api/openapi.yaml | |
| retention-days: 1 | |
| validate: | |
| name: Validate bundled specification | |
| runs-on: ubuntu-latest | |
| needs: [lint, build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: "npm" | |
| cache-dependency-path: "package-lock.json" | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Install dependencies | |
| run: npm ci --force | |
| - name: Download bundles | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: openapi-bundles | |
| path: static/api/ | |
| - name: Validate YAML bundle | |
| run: npx redocly lint static/api/openapi.yaml | |
| - name: Validate JSON bundle | |
| run: npx redocly lint static/api/openapi.json | |
| - name: Check bundle sizes | |
| run: | | |
| JSON_SIZE=$(stat -f%z static/api/openapi.json 2>/dev/null || stat -c%s static/api/openapi.json) | |
| YAML_SIZE=$(stat -f%z static/api/openapi.yaml 2>/dev/null || stat -c%s static/api/openapi.yaml) | |
| echo "Bundle sizes:" | |
| echo " JSON: $JSON_SIZE bytes" | |
| echo " YAML: $YAML_SIZE bytes" | |
| if [[ "$JSON_SIZE" -lt 1000 ]] || [[ "$YAML_SIZE" -lt 1000 ]]; then | |
| echo "Error: Bundle files are suspiciously small" | |
| exit 1 | |
| fi | |
| echo "✓ Bundles have valid sizes" | |
| # When a PR changes OpenAPI specs and passes validation, trigger model regeneration in apify-client-python | |
| # so the Python client stays in sync with the API spec. | |
| trigger-client-model-regeneration: | |
| name: Trigger Python client model regeneration | |
| runs-on: ubuntu-latest | |
| needs: [validate] | |
| if: >- | |
| github.event_name == 'pull_request' | |
| && github.event.action != 'closed' | |
| && github.event.pull_request.head.repo.full_name == github.repository | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Check if OpenAPI files changed | |
| id: changed-files | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| files: 'apify-api/openapi/**' | |
| - name: Trigger apify-client-python model regeneration | |
| if: steps.changed-files.outputs.any_changed == 'true' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| PR_AUTHOR: ${{ github.event.pull_request.user.login }} | |
| run: | | |
| gh workflow run manual_regenerate_models.yaml \ | |
| --repo apify/apify-client-python \ | |
| --field docs_pr_number="$PR_NUMBER" \ | |
| --field docs_workflow_run_id="${{ github.run_id }}" \ | |
| --field docs_pr_author="$PR_AUTHOR" | |
| # When a docs PR is closed without being merged, clean up the corresponding auto-generated PR | |
| # in apify-client-python to avoid stale PRs piling up. | |
| # If the docs PR is merged, the client PR is left open for manual review and merge. | |
| cleanup-client-model-pr: | |
| name: Close Python client model PR on docs PR close | |
| runs-on: ubuntu-latest | |
| if: >- | |
| github.event_name == 'pull_request' | |
| && github.event.action == 'closed' | |
| && github.event.pull_request.merged == false | |
| && github.event.pull_request.head.repo.full_name == github.repository | |
| steps: | |
| - name: Close corresponding apify-client-python PR | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| # Branch name convention must match what manual_regenerate_models.yaml creates. | |
| run: | | |
| BRANCH="update-models-docs-pr-${PR_NUMBER}" | |
| EXISTING_PR=$(gh pr list \ | |
| --repo apify/apify-client-python \ | |
| --head "$BRANCH" \ | |
| --json number \ | |
| --jq '.[0].number // empty' 2>/dev/null || true) | |
| if [[ -n "$EXISTING_PR" ]]; then | |
| gh pr close "$EXISTING_PR" \ | |
| --repo apify/apify-client-python \ | |
| --delete-branch \ | |
| --comment "Closing this PR because the source apify-docs PR #${PR_NUMBER} was closed without merging." | |
| echo "Closed apify-client-python PR #$EXISTING_PR" | |
| else | |
| echo "No corresponding apify-client-python PR found for branch $BRANCH" | |
| fi |