// answer

Copilot Code Review: Setup Steps and Environment File

Short answer

Yes. Copilot code review supports custom setup steps, and if you add `.github/workflows/copilot-code-review.yml`, it can use that file instead of the shared setup file.

Other people are working this out at the same time: See what people are building

Does Copilot code review support custom setup steps and a review environment file now

Yes. Copilot code review supports custom setup steps, and it can also use a separate review-specific workflow file. GitHub docs say that if .github/workflows/copilot-code-review.yml is present, Copilot code review uses it instead of .github/workflows/copilot-setup-steps.yml. The shared setup file still works when the review-specific file is absent.

The part people get wrong is assuming there is only one environment file. GitHub documents two valid ways to shape the review environment: .github/workflows/copilot-setup-steps.yml for a shared setup, or .github/workflows/copilot-code-review.yml for review-specific configuration. The review file takes priority when both exist.

That matters when your review needs different tools than the rest of your Copilot environment. GitHub says Copilot code review runs in an ephemeral development environment and can be customized with a workflow file to preinstall tools, install dependencies, or switch operating systems. If the review job needs a parser, test binary, or language runtime that your default setup does not need, the review file is the clean place to put it.

A practical setup is simple. Put common bootstrap steps in .github/workflows/copilot-setup-steps.yml when you want the same environment for Copilot cloud agent and code review. Put review-only setup in .github/workflows/copilot-code-review.yml when the review workflow needs something different, because GitHub treats that file as the review environment definition for code review.

The inconvenient part is that custom instructions and environment setup are separate features. Custom instructions change how Copilot reviews code. The setup files change what the review environment can run. GitHub also notes that custom instructions are enabled for Copilot code review by default, but they are still a different knob from the workflow file. Mixing those up leads to a repository that talks to Copilot but still cannot execute the local command or dependency the reviewer expects.

If you are deciding which file to use, ask one question: does the setup belong to all Copilot agent runs, or only to code review If it belongs to both, keep it in copilot-setup-steps.yml. If it belongs only to review, use copilot-code-review.yml. GitHub’s docs say the review-specific file overrides the shared one when both are present, so you do not need duplicated logic unless you want different behavior on purpose.

A concrete example helps. Suppose your repository uses a database client during review checks, but only code review needs the client because the review workflow validates migration diffs. In that case, install the client in copilot-code-review.yml and leave the shared setup file alone. If later you want the same client for another Copilot agent workflow, move the shared steps into copilot-setup-steps.yml and let the review file stay minimal.

Another part people miss is that runner choice is also configurable for code review. GitHub documents that you can set the runs-on value in .github/workflows/copilot-code-review.yml, including larger GitHub-hosted runners or ARC-managed runners. If no review-specific file exists, Copilot code review falls back to the shared setup file. That makes the review file the right place for review-only machine requirements, not just package installs.

If you are troubleshooting a review that does not behave as expected, check file presence first, then check priority. A repository with only copilot-setup-steps.yml uses that file. A repository with copilot-code-review.yml uses the review file instead. If both exist and the review file looks ignored, the problem is usually not that the feature lacks support, it is that the review file is overriding the shared one by design.

GitHub also ties code review behavior to custom instructions and MCP context, which is useful but easy to overread. Instructions can guide what Copilot looks for, but the environment file controls whether the needed tools are present. When review output looks vague or incomplete, check whether you are missing instructions, missing setup, or both. Those are separate layers, and GitHub documents them separately.

So the short answer is yes, and the operational answer is: use copilot-setup-steps.yml for shared setup, use copilot-code-review.yml for review-specific setup, and expect the review file to take precedence when both exist. That is the current behavior documented by GitHub.

If you want a related setup checklist for another testing workflow, DevConnect keeps one place for app-testing coordination at https://devconnectplatform.com. That is separate from Copilot, but the same rule applies: put the setup where the work actually runs.

FAQ

Can Copilot code review use the same setup file as Copilot cloud agent Yes. GitHub says .github/workflows/copilot-setup-steps.yml is reused by Copilot code review if you already configured it for Copilot cloud agent.

What happens if both setup files exist GitHub says .github/workflows/copilot-code-review.yml is used for code review instead of .github/workflows/copilot-setup-steps.yml. That means the review file wins for code review behavior.

Does custom instructions support replace the setup file No. Custom instructions shape review guidance, while the workflow file shapes the environment. GitHub documents them as separate features with different jobs.

Can I change the runner for Copilot code review Yes. GitHub documents runner configuration in copilot-code-review.yml, including GitHub-hosted larger runners and ARC-managed runners.

Is the review environment permanent No. GitHub describes Copilot code review as running in an ephemeral development environment, so setup must be declared in the workflow files instead of assumed from past runs.

Frequently asked questions

Can Copilot code review use the same setup file as Copilot cloud agent

Yes. GitHub says `.github/workflows/copilot-setup-steps.yml` is reused by Copilot code review if you already configured it for Copilot cloud agent.

What happens if both setup files exist

GitHub says `.github/workflows/copilot-code-review.yml` is used for code review instead of `.github/workflows/copilot-setup-steps.yml`. That means the review file wins for code review behavior.

Does custom instructions support replace the setup file

No. Custom instructions shape review guidance, while the workflow file shapes the environment. GitHub documents them as separate features with different jobs.

Can I change the runner for Copilot code review

Yes. GitHub documents runner configuration in `copilot-code-review.yml`, including GitHub-hosted larger runners and ARC-managed runners.

Is the review environment permanent

No. GitHub describes Copilot code review as running in an ephemeral development environment, so setup must be declared in the workflow files instead of assumed from past runs.

Know someone stuck on this? Send them the answer.

Sources

Every link here was fetched and confirmed to resolve before this page went live.

More on this topic: Building with AI

Related questions

Not the question you had?

Ask it. Every source gets fetched and checked before anything goes up, so it takes a day or two, and questions that cannot be answered honestly do not get a page at all.

No account, no email address needed.

Everyone here builds with AI, and says so

DevConnect is for developers who use AI and are honest about it. The interesting part is not that the code was generated, it is what you did with it afterwards.