Skip to content

chore: enable auto-format on PRs targeting production#31208

Open
MohamedH1998 wants to merge 1 commit into
productionfrom
chore/auto-format-to-prod
Open

chore: enable auto-format on PRs targeting production#31208
MohamedH1998 wants to merge 1 commit into
productionfrom
chore/auto-format-to-prod

Conversation

@MohamedH1998
Copy link
Copy Markdown
Contributor

Summary

Flips the auto-format build workflow's branches: filter from [auto-format-canary] to [production], so the bot now runs on real PRs.

Verified end-to-end against canary PRs: prettier produces a diff for changed files, the patch is validated against the path allowlist, and cloudflare-docs-bot[bot] pushes a style: format commit back to the PR branch.

Effect

The auto-format bot will now fire on every PR opened against production that touches a prettier-scoped file (.js .jsx .ts .tsx .mjs .css .json .yaml .yml .md .astro). When prettier produces a diff, cloudflare-docs-bot[bot] pushes a style: format commit back to the PR branch (same-repo or fork), CI re-runs against the formatted code.

The CI safety net (Check formatting (changed files) in ci.yml) is retained — it'll be removed in a follow-up after a soak period.

Verification

The workflow has been tested against PR targeting auto-format-canary without any issues:

Screenshots (optional)

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

@cloudflare-docs-bot
Copy link
Copy Markdown

cloudflare-docs-bot Bot commented Jun 3, 2026

Review

✅ No style-guide issues found in commit fa74679.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/.github/ @cloudflare/content-engineering, @kodster28, @mvvmm, @colbywhite, @ahaywood, @MohamedH1998

@ask-bonk ask-bonk Bot added the engineering Problems or updates to developers.cloudflare.com website label Jun 3, 2026
Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

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

Clean infrastructure change — no issues.

What it does: Changes the branch filter from to , enabling the auto-format bot to run on real PRs.

Checks passed:

  • Branch name () matches the repo's primary branch.
  • Companion workflow () correctly triggers via and needs no changes.
  • Bot-loop guard () is in place.
  • Patch validation, path allowlisting, and stale-head checks in the apply workflow are unchanged and effective.
  • The CI formatting safety net in remains as described.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Jun 3, 2026

Auto-review note: the backtick-quoted workflow filenames above got swallowed by shell interpolation. The review is an approval with no blocking issues. The diff correctly flips → in .

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Jun 3, 2026

Review complete for PR #31208 — approved with no blocking issues.

Summary of changes

Changes a single line in .github/workflows/auto-format-build.yml: flips the branches filter from [auto-format-canary] to [production], enabling the auto-format bot to run on real PRs targeting the production branch.

Labels applied

  • engineering (in addition to the existing size/xs)

Issues flagged

None. The change is minimal and correct.

Verification checked

  • production is the repo's primary branch (per AGENTS.md).
  • Companion workflow (auto-format-apply.yml) triggers via workflow_run and needs no changes.
  • Bot-loop prevention (github.actor != 'cloudflare-docs-bot[bot]') is in place.
  • Patch path validation, blocked-path checks, stale-head SHA verification, and fork-vs-same-repo push logic in the apply workflow remain intact.
  • The CI formatting safety net in ci.yml is retained, matching the PR description.

github run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineering Problems or updates to developers.cloudflare.com website size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants