fix: preserve branch name in release notes workflow to reuse PRs - #3822
Merged
Conversation
The create-pull-request safe output adds a random salt suffix to branch
names by default (preserve-branch-name defaults to false). This caused
every workflow run to create a new branch and a new PR instead of
updating the existing one for the same version.
Setting preserve-branch-name: true ensures the agent-specified branch
name (dev/release-notes-{VERSION}) is used exactly, so subsequent runs
push to the same branch and update the same PR.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
📦 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 -- 3822PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 3822"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-3822/packages --name skiasharp-pr-3822More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-3822 |
Contributor
|
📖 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
update-release-notesagentic workflow creates duplicate PRs on every run instead of updating a single PR per version. For example, version 4.147.0 has 3 open PRs (#3818, #3819, #3820) and many more closed duplicates.Root Cause
The
create-pull-requestsafe output in gh-aw appends a random salt suffix to agent-specified branch names by default (preserve-branch-namedefaults tofalse).The workflow instructs the agent to use
dev/release-notes-{VERSION}as the branch name, but each run gets a unique branch like:dev/release-notes-4.147.0-2fddc6e409a25161→ PR [docs] Update release notes for 4.147.0 #3818dev/release-notes-4.147.0-cd82989ab99ac49c→ PR [docs] Update release notes for 4.147.0 (in development) #3819dev/release-notes-4.147.0-e58102bf3e66254c→ PR [docs] docs: release notes for 4.147.0 (unreleased) #3820Fix
Add
preserve-branch-name: trueto thecreate-pull-requestsafe output configuration. This skips the random salt suffix so the exact branch namedev/release-notes-{VERSION}is used, and subsequent runs update the same PR.After Merging
The 3 duplicate open PRs (#3818, #3819, #3820) should be closed manually.