Repository navigation
Fix release notes workflow to always checkout main - #4059
Conversation
The update-release-notes agentic workflow previously checked out whatever
branch triggered it (e.g. release/4.147.0-preview.3). Since the script only
uses origin/ remote refs, this caused unrelated file diffs (like PREVIEW_LABEL)
to bleed into the PR targeting main.
Changes:
- Add git checkout main + git fetch origin in Step 2 so the working tree
is always based on main regardless of the triggering ref
- Use distinct PR branch names for released vs unreleased notes
(dev/release-notes-{VERSION}-released vs -unreleased) to prevent
branch collisions between release and main triggers
Fixes the issue seen in PR #4053 where release-branch-specific changes
were included in the docs PR.
Co-authored-by: Copilot <[email protected]>
📦 Try the packages from this PRWarning Do not run these scripts without first reviewing the code in this PR. Step 1 — Download the packages bash / macOS / Linux: curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4059PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4059"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4059/packages --name skiasharp-pr-4059More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4059 |
There was a problem hiding this comment.
Pull request overview
This PR updates the Update Release Notes agentic workflow instructions to ensure release notes PRs are generated from a main working tree (avoiding release-branch-only file diffs bleeding into PRs targeting main) and to prevent PR branch-name collisions between release-branch and main triggers.
Changes:
- Document always switching the working tree to
mainbefore generating release notes. - Document distinct PR branch naming for released vs unreleased runs to avoid force-push collisions.
|
📖 Documentation Preview The documentation for this PR has been deployed and is available at: 🔗 View Staging Site This preview will be updated automatically when you push new commits to this PR. This comment is automatically updated by the documentation staging workflow. |
Address review feedback: with fetch-depth: 1 on release-branch triggers, the local 'main' branch may not exist. Fetch origin/main first, then force-create the local branch with checkout -B main origin/main. Co-authored-by: Copilot <[email protected]>
Problem
When a push to a release branch (e.g.
release/4.147.0-preview.3) triggers theupdate-release-notesworkflow, the agent checks out that release branch. Since the PR targetsmain, unrelated file diffs (likePREVIEW_LABELinscripts/azure-templates-variables.yml) bleed into the PR.This happened in PR #4053 which was closed due to the extra diff.
Additionally, both released and unreleased triggers used the same PR branch name (
dev/release-notes-{VERSION}), causing collisions where a main push would force-push over a release-branch PR.Fix
Always work from
maincheckout — Addedgit checkout main+git fetch originin Step 2 so the working tree is always based on main, regardless of the triggering ref. The script only usesorigin/remote refs so this is safe.Distinct PR branch names — Changed Step 3 to use:
dev/release-notes-{VERSION}-releasedfor release branch triggersdev/release-notes-{VERSION}-unreleasedfor main triggersThis prevents branch collisions between release and main triggers.