fix(ci): resolve super-linter v8 failures (Biome + Zizmor) (#37) #5
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: Apply Kuma config | |
| # Reconciles kuma-config/ onto the prod Kuma (status.zfnd.org) on merge to main. | |
| # apply.js is declarative and non-destructive. Manual re-run via workflow_dispatch. | |
| # Auth: WIF (keyless) -> a least-privilege SA that reads the admin/webhook secrets | |
| # from Secret Manager. No secrets are stored in GitHub. | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'kuma-config/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: apply-kuma-config | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| apply: | |
| runs-on: ubuntu-latest | |
| environment: prod | |
| timeout-minutes: 10 | |
| # Only ever reconcile prod from main — a workflow_dispatch on a feature branch | |
| # must not apply unmerged kuma-config to prod. | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0 | |
| with: | |
| workload_identity_provider: ${{ vars.GCP_WIF }} | |
| service_account: ${{ vars.GCP_KUMA_APPLIER_SA }} | |
| project_id: ${{ vars.GCP_PROJECT }} | |
| - name: Set up Cloud SDK | |
| uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1 | |
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: '20' | |
| - name: Apply config-as-code | |
| working-directory: kuma-config | |
| env: | |
| KUMA_URL: ${{ vars.KUMA_PUBLIC_URL }} | |
| KUMA_USERNAME: ${{ vars.KUMA_USERNAME }} | |
| GCP_PROJECT: ${{ vars.GCP_PROJECT }} | |
| run: | | |
| set -euo pipefail | |
| KUMA_PASSWORD="$(gcloud secrets versions access latest --secret=UPTIME_KUMA_ADMIN_PASSWORD --project="$GCP_PROJECT")" | |
| SLACK_WEBHOOK_URL="$(gcloud secrets versions access latest --secret=SLACK_WEBHOOK_URL --project="$GCP_PROJECT")" | |
| echo "::add-mask::$KUMA_PASSWORD" | |
| echo "::add-mask::$SLACK_WEBHOOK_URL" | |
| export KUMA_PASSWORD SLACK_WEBHOOK_URL | |
| npm ci | |
| node apply.js |