feat(pr-sous-chef): run formatters and push to branch#33125
Merged
Conversation
- Add checkout config with fetch: ["refs/pulls/open/*"] and fetch-depth: 0 - Add network: allowed: ["defaults", "go"] for Go module access - Add setup steps: Go, Node.js, npm ci, make deps-dev - Add bash tools: git fetch/checkout/diff/status/restore, make fmt - Add edit: tool - Add push-to-pull-request-branch safe-output (target: *, if-no-changes: ignore) - Update agent instructions with step 0: run make fmt and push if dirty - Increase timeout-minutes to 25 to account for setup and formatting cycles - Track formatter_pushes in run summary Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
May 18, 2026 18:54
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the pr-sous-chef agentic workflow to proactively run repository formatters (make fmt) on eligible PR branches and push resulting formatting fixes back to the PR branch.
Changes:
- Fetches all open PR refs with full history and allows Go module network access to support formatter execution.
- Adds Go/Node toolchain setup + dependency installation steps needed for
make fmt. - Enables
push_to_pull_request_branchsafe-output with guardrails (excluded workflow files, commit title suffix) and increases workflow timeout; updates run summary to includeformatter_pushes.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/pr-sous-chef.md | Adds checkout/network/tooling setup and agent instructions to run make fmt per PR and push changes via a new safe-output. |
| .github/workflows/pr-sous-chef.lock.yml | Recompiled lock file reflecting new setup steps, fetched refs, safe-output tool wiring, permissions, and timeout changes. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
| - Checkout the PR branch: `git checkout <headRefName>` | ||
| - Run `make fmt` to format all code (Go, JavaScript, JSON) | ||
| - Check for changes: `git diff --quiet || echo "dirty"` | ||
| - If dirty, call `push_to_pull_request_branch` with the PR number to push the formatting fixes |
Comment on lines
+199
to
+205
| 0. **Run formatters and push if needed** | ||
| - Checkout the PR branch: `git checkout <headRefName>` | ||
| - Run `make fmt` to format all code (Go, JavaScript, JSON) | ||
| - Check for changes: `git diff --quiet || echo "dirty"` | ||
| - If dirty, call `push_to_pull_request_branch` with the PR number to push the formatting fixes | ||
| - Return to the original branch: `git checkout -` | ||
| - Skip this step silently if `make fmt` exits non-zero (tools unavailable) |
This was referenced May 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pr-sous-chefpreviously only nudged PRs via comments and branch updates. This extends it to actively fix formatting issues by runningmake fmton each eligible PR branch and pushing any changes back.Frontmatter changes (lock file recompiled)
checkout:fetch: ["refs/pulls/open/*"],fetch-depth: 0— makes all open PR branches available locallynetwork:allowed: ["defaults", "go"]— permits Go module downloads duringfmtnpm ci,make deps-dev— installs formatter toolchain into agent sandboxedit:and bash allowlist entries forgit fetch/checkout/diff/status/restore+make fmtpush-to-pull-request-branch:target: "*",if-no-changes: ignore,excluded-files: [".github/workflows/**"], suffix[pr-sous-chef]Agent instructions (no recompile needed)
New step 0 prepended to Required nudges for eligible PRs:
formatter_pushescounter added to the run-summarynoop.