Skip to content

Auto-exclude copilot environment from CI/CD deployments#2279

Open
aholstrup1 wants to merge 3 commits into
mainfrom
aholstrup1/exclude-copilot-environment
Open

Auto-exclude copilot environment from CI/CD deployments#2279
aholstrup1 wants to merge 3 commits into
mainfrom
aholstrup1/exclude-copilot-environment

Conversation

@aholstrup1

Copy link
Copy Markdown
Collaborator

When the GitHub Copilot coding agent is enabled on a repository, GitHub auto-creates an environment named copilot. DetermineDeploymentEnvironments enumerates all GitHub environments and was picking it up as a CD target, so the Deploy job ran with no DeployTo settings and no AuthContext secret and failed with Authentication failed at Deploy.ps1:128.

This treats copilot the same way github-pages is already treated: it is appended to the implicit excludeEnvironments list, so it never reaches the deployment matrix.

Changes:

  • Actions/DetermineDeploymentEnvironments/DetermineDeploymentEnvironments.ps1 - add copilot next to github-pages in the implicit exclude list
  • Scenarios/settings.md - mention copilot in the existing excludeEnvironments description
  • RELEASENOTES.md - note the fix under Issues

Fixes: #2277

Copilot AI review requested due to automatic review settings June 12, 2026 10:14
@aholstrup1 aholstrup1 requested a review from a team as a code owner June 12, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents GitHub’s auto-created copilot environment (created when the Copilot coding agent is enabled) from being treated as a CI/CD deployment target by DetermineDeploymentEnvironments, avoiding Deploy job failures due to missing DeployTo* settings / auth context.

Changes:

  • Implicitly appends copilot to the excludeEnvironments list (alongside github-pages) in DetermineDeploymentEnvironments.
  • Documents the implicit exclusion of copilot in Scenarios/settings.md.
  • Adds a release note entry describing the fix for Issue #2277.

Reviewed changes

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

File Description
Actions/DetermineDeploymentEnvironments/DetermineDeploymentEnvironments.ps1 Excludes copilot from the environment enumeration used to build the deployment matrix.
Scenarios/settings.md Updates settings documentation to note that copilot is implicitly excluded.
RELEASENOTES.md Records the fix in the release notes.

Comment thread RELEASENOTES.md Outdated
Comment thread Scenarios/settings.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: CI/CD Deploy to "coppilot" fail

3 participants