Skip to content

fix(ci): align workflows with the default branch#1571

Closed
jaypatrick wants to merge 4 commits intomainfrom
fix/workflow-default-branch
Closed

fix(ci): align workflows with the default branch#1571
jaypatrick wants to merge 4 commits intomainfrom
fix/workflow-default-branch

Conversation

@jaypatrick
Copy link
Copy Markdown
Owner

Description

Changes

Testing

  • Unit tests added/updated
  • Manual testing performed
  • CI passes

Zero Trust Architecture Checklist

Required for every PR touching worker/ or frontend/.
Check each item that applies. If an item doesn't apply, check it and note "N/A".

Worker / Backend

  • Every handler verifies auth before executing business logic
  • CORS origin allowlist enforced (not *) on write/authenticated endpoints
  • All secrets accessed via Worker Secret bindings (not [vars])
  • All external inputs Zod-validated before use
  • All D1 queries use parameterized .prepare().bind() (no string interpolation)
  • Security events emitted to Analytics Engine on auth failures

Frontend / Angular

  • Protected routes have functional CanActivateFn auth guards
  • Auth tokens managed via Clerk SDK (not localStorage)
  • HTTP interceptor attaches Bearer token (no manual token passing)
  • API responses validated with Zod schemas before consumption

API Shield / Vulnerability Scanner

Required for every PR touching docs/api/openapi.yaml, worker/routes/, or resource endpoint handlers.

  • New/changed endpoints have a unique operationId in openapi.yaml
  • Resource endpoints (those with /{id} path parameters) include a security: annotation
  • Resource queries are scoped to the authenticated user (WHERE user_id = ?) — not just by ID
  • Missing/unauthorized resources return 404 (not 403) to avoid leaking resource existence
  • cloudflare-schema.yaml regenerated if openapi.yaml changed (deno task schema:cloudflare)

If this PR does not touch worker/ or frontend/, the ZTA checklist is not required.
If this PR does not touch openapi.yaml or resource handlers, the API Shield checklist is not required.

@jaypatrick jaypatrick self-assigned this Apr 14, 2026
Copilot AI review requested due to automatic review settings April 14, 2026 00:35
@jaypatrick jaypatrick added bug Something isn't working deployment Deployment tasks labels Apr 14, 2026
@jaypatrick jaypatrick added this to the beta milestone Apr 14, 2026
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates GitHub Actions workflows to be compatible with repositories whose default branch may be main or master, and standardizes several workflow files’ YAML formatting.

Changes:

  • Expand workflow triggers from main-only to master/main in multiple workflows.
  • Replace hard-coded refs/heads/main checks with github.event.repository.default_branch comparisons where supported.
  • Reformat/normalize YAML quoting and indentation across workflows.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.github/workflows/zta-lint.yml Updates push branch filter to include master and normalizes quoting.
.github/workflows/sentry-worker.yml Updates push branch filter to include master and normalizes quoting.
.github/workflows/sentry-frontend.yml Updates push branch filter to include master and reindents/normalizes YAML.
.github/workflows/mdbook.yml Updates push branch filter to include master and normalizes quoting.
.github/workflows/lighthouse.yml Updates workflow_run branch filter to include master and normalizes YAML.
.github/workflows/frontend-version-bump.yml Updates trigger branches to include master and reindents/normalizes YAML.
.github/workflows/db-migrate.yml Updates triggers to include master, uses default-branch ref checks for apply jobs, and normalizes YAML.
.github/workflows/claude.yml Updates push branch filter to include master and normalizes quoting.
.github/workflows/ci.yml Updates triggers to include master, switches deploy/publish gating to default-branch refs, and normalizes YAML.
.github/workflows/bench.yml Updates trigger branches to include master and normalizes quoting.
.github/workflows/api-shield-scan.yml Updates triggers to include master and normalizes YAML.
.github/actions/deploy-worker/action.yml Tweaks deploy action warning messaging related to container push permissions.

@jaypatrick
Copy link
Copy Markdown
Owner Author

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

@copilot apply changes based on the comments in this thread

Applied all four changes from the review thread in commit 9418f4b:

  • frontend-version-bump.yml: Added DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} to the step env, replaced --base main with --base "$DEFAULT_BRANCH", and updated the echo log messages accordingly.
  • db-migrate.yml (line ~226): Added const defaultBranch = context.payload.repository?.default_branch || 'default branch' and used it in the PR comment body instead of the hard-coded `main`.
  • db-migrate.yml (line ~297): Updated the section header comment from # Apply D1 migrations (main push only) to # Apply D1 migrations (default-branch push only).
  • ci.yml (line ~674): Restored cloudflare-containers-token: ${{ secrets.CLOUDFLARE_CONTAINERS_TOKEN }} to the deploy-worker action call.

@jaypatrick jaypatrick marked this pull request as ready for review April 14, 2026 00:48
Copilot AI review requested due to automatic review settings April 14, 2026 00:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

@jaypatrick
Copy link
Copy Markdown
Owner Author

@copilot apply changes based on the comments in this thread

…branch equivalents

Agent-Logs-Url: https://github.com/jaypatrick/adblock-compiler/sessions/483724fe-4263-403a-8765-5ab4673344e7

Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

@copilot apply changes based on the comments in this thread

Applied all five changes from the review thread in commit b7e96c5:

  • mdbook.yml: Changed --branch=main--branch="${{ github.ref_name }}" so Cloudflare Pages always receives the actual triggering branch name.
  • db-migrate.yml concurrency comment: "On main we never want…" → "On the default branch we never want…"
  • ci.yml verify-deploy comment: "skipped on push to main" → "skipped on pushes to the repository default branch"
  • frontend-version-bump.yml lines 217–218: "version bump commit reaches main" → "reaches the default branch"
  • frontend-version-bump.yml lines 234–235: "--merge" comment updated from "stays in main history / find the tag from main" → "default branch history / find the tag from the default branch"

@jaypatrick jaypatrick closed this Apr 14, 2026
@jaypatrick jaypatrick deleted the fix/workflow-default-branch branch April 14, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working deployment Deployment tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants