docs: add scale and HA sizing guide. index.md: extend. #1660
Workflow file for this run
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: pre-commit | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| env: | |
| TERRAFORM_DOCS_VERSION: "0.20.0" | |
| TERRAFORM_DOCS_OS_ARCH: "linux-amd64" | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.head.ref || github.ref }} | |
| fetch-depth: 0 | |
| # Cache terraform-docs binary to avoid downloading it every run | |
| - name: Cache terraform-docs | |
| id: cache-terraform-docs | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ~/.local/bin/terraform-docs | |
| key: terraform-docs-${{ env.TERRAFORM_DOCS_VERSION }}-${{ env.TERRAFORM_DOCS_OS_ARCH }} | |
| # Install terraform-docs into ~/.local/bin and add it to PATH | |
| - name: Install terraform-docs (if not cached) | |
| if: steps.cache-terraform-docs.outputs.cache-hit != 'true' | |
| run: | | |
| set -euo pipefail | |
| echo "[terraform-docs] Cache miss -> downloading v${TERRAFORM_DOCS_VERSION}..." | |
| mkdir -p "$HOME/.local/bin" | |
| curl -fsSL -o /tmp/td.tgz \ | |
| "https://github.com/terraform-docs/terraform-docs/releases/download/v${TERRAFORM_DOCS_VERSION}/terraform-docs-v${TERRAFORM_DOCS_VERSION}-${TERRAFORM_DOCS_OS_ARCH}.tar.gz" | |
| tar -xzf /tmp/td.tgz -C "$HOME/.local/bin" terraform-docs | |
| chmod +x "$HOME/.local/bin/terraform-docs" | |
| - name: verify terraform-docs | |
| run: | | |
| set -euo pipefail | |
| terraform-docs --version | |
| - id: run-pre-commit | |
| uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
| continue-on-error: true | |
| - name: Create GitHub App token for Renovate auto-fix pushes | |
| id: renovate-app-token | |
| if: ${{ always() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && (startsWith(github.event.pull_request.head.ref, 'renovate/') || contains(github.event.pull_request.user.login, 'renovate')) }} | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 | |
| with: | |
| app-id: ${{ secrets.RENOVATE_GITHUB_APP_ID }} | |
| private-key: ${{ secrets.RENOVATE_GITHUB_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: | | |
| ${{ github.event.repository.name }} | |
| - name: Auto-commit pre-commit fixes (same-repo PRs) | |
| id: autofix | |
| if: ${{ always() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} | |
| shell: bash | |
| env: | |
| AUTOFIX_PUSH_TOKEN: ${{ steps.renovate-app-token.outputs.token }} | |
| run: | | |
| set -euo pipefail | |
| if git diff --quiet; then | |
| echo "committed=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| if git diff --cached --quiet; then | |
| echo "committed=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| git commit -m "ci(pre-commit): apply auto-fixes" | |
| if [ -n "${AUTOFIX_PUSH_TOKEN:-}" ]; then | |
| git remote set-url origin "https://x-access-token:${AUTOFIX_PUSH_TOKEN}@github.com/${{ github.repository }}.git" | |
| fi | |
| git push origin "HEAD:${{ github.event.pull_request.head.ref }}" | |
| echo "committed=true" >> "$GITHUB_OUTPUT" | |
| - uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0 | |
| if: ${{ always() && steps.run-pre-commit.outcome == 'failure' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} | |
| - name: Fail if pre-commit errors remain | |
| if: ${{ steps.run-pre-commit.outcome == 'failure' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository || steps.autofix.outputs.committed != 'true') }} | |
| shell: bash | |
| run: | | |
| echo "::error::pre-commit checks failed and no auto-fix commit was pushed." | |
| exit 1 |