Skip to content

Prevent copilot-maintenance workflow from running on forks#24082

Merged
pelikhan merged 1 commit intomainfrom
copilot/add-check-prevent-running-from-fork
Apr 2, 2026
Merged

Prevent copilot-maintenance workflow from running on forks#24082
pelikhan merged 1 commit intomainfrom
copilot/add-check-prevent-running-from-fork

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

The "Copilot Maintenance" workflow was being triggered on fork repositories, causing branch deletion operations to run outside the intended github/gh-aw context.

Changes

  • Added if: github.repository == 'github/gh-aw' condition to the delete-old-copilot-branches job, skipping the job entirely when run from a fork

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/51089701-6b34-45e2-977f-15f676b5651e

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review April 2, 2026 11:54
Copilot AI review requested due to automatic review settings April 2, 2026 11:54
@pelikhan pelikhan merged commit b7a6f35 into main Apr 2, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/add-check-prevent-running-from-fork branch April 2, 2026 11:54
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

Prevents the “Copilot Maintenance” workflow from performing branch deletion actions when the workflow runs in forked repositories, restricting execution to the intended upstream repo (github/gh-aw).

Changes:

  • Added a job-level if condition to only run delete-old-copilot-branches when github.repository matches github/gh-aw.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants