Skip to content

Fix release notes workflow to always checkout main - #4059

Merged
mattleibow merged 2 commits into
mainfrom
mattleibow/psychic-guide
May 24, 2026
Merged

mattleibow merged 2 commits into
mainfrom
mattleibow/psychic-guide

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Problem

When a push to a release branch (e.g. release/4.147.0-preview.3) triggers the update-release-notes workflow, the agent checks out that release branch. Since the PR targets main, unrelated file diffs (like PREVIEW_LABEL in scripts/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

  1. Always work from main checkout — Added git checkout main + git fetch origin in Step 2 so the working tree is always based on main, regardless of the triggering ref. The script only uses origin/ remote refs so this is safe.

  2. Distinct PR branch names — Changed Step 3 to use:

    • dev/release-notes-{VERSION}-released for release branch triggers
    • dev/release-notes-{VERSION}-unreleased for main triggers

    This prevents branch collisions between release and main triggers.

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]>
@github-actions

github-actions Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

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 -- 4059

PowerShell / 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-4059
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-4059

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 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 main before generating release notes.
  • Document distinct PR branch naming for released vs unreleased runs to avoid force-push collisions.

@github-actions

github-actions Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation for this PR has been deployed and is available at:

🔗 View Staging Site
🔗 View Staging Docs
🔗 View Staging Gallery (Blazor)
🔗 View Staging Gallery (Uno Platform)
🔗 View Staging SkiaFiddle

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]>
@mattleibow
mattleibow merged commit de3ef16 into main May 24, 2026
3 checks passed
@mattleibow
mattleibow deleted the mattleibow/psychic-guide branch May 24, 2026 21:20
github-actions Bot pushed a commit that referenced this pull request May 24, 2026
mattleibow added a commit that referenced this pull request May 26, 2026
@mattleibow mattleibow added this to the 4.148.0-rc.1 milestone Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants