Skip to content

Restrict extension release publishing to main - #9639

Open
JeffreyCA with Copilot wants to merge 2 commits into
mainfrom
copilot/restrict-extension-release-publishing
Open

Restrict extension release publishing to main#9639
JeffreyCA with Copilot wants to merge 2 commits into
mainfrom
copilot/restrict-extension-release-publishing

Conversation

Copilot AI commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #9408

Summary

This PR prevents extension release publishing from feature branches. Manual extension pipeline runs can still build, test, sign, and package artifacts, but only runs sourced from refs/heads/main may enter the shared publishing stage.

Issue

A manual run from any branch could create a real Git tag and GitHub release, upload artifacts to the durable <extension>/<version> storage path, and open a registry update PR. A feature branch could therefore consume a release tag before the official main release and block that release until someone manually deleted the conflicting tag and GitHub release.

Change

The PublishExtension stage now requires:

eq(variables['Build.SourceBranch'], 'refs/heads/main')

Applying the guard at the stage boundary covers GitHub release creation, durable storage uploads, and registry updates. Build and signing stages remain available on any branch. PR bundle publishing from #9553 is separate and remains available where that pipeline integration is enabled.

Testing

Azure Pipelines run 20260819.1 exercised commit b36521529008d921ae98387c88b23f35441a7c9f from refs/heads/copilot/restrict-extension-release-publishing.

The run completed successfully and produced the expected build and signed release artifacts. Azure Pipelines skipped the complete PublishExtension stage for the feature branch. Skip.Publish=true and Skip.RegistryUpdate=true were also set as safeguards.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
19 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Copilot AI changed the title [WIP] Restrict extension release publishing to main branch Restrict extension release publishing to main Aug 19, 2026
Copilot AI requested a review from JeffreyCA August 19, 2026 17:43
@JeffreyCA
JeffreyCA marked this pull request as ready for review August 19, 2026 20:22
Copilot AI balanced review requested due to automatic review settings August 19, 2026 20:22
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

Restricts official extension publishing to builds sourced from main, preventing feature branches from creating conflicting releases.

Changes:

  • Adds a Build.SourceBranch guard to the publishing stage.
  • Keeps build, test, signing, packaging, and PR bundle flows unchanged.
Show a summary per file
File Description
eng/pipelines/templates/stages/publish-extension.yml Limits the shared release publishing stage to refs/heads/main.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag Rick Winter (@RickWinter) and Kristen Womack (@kristenwomack) to let us know.

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.

[Extensions] Restrict extension release publishing to main

3 participants