Skip to content

Refactor backmerge-release.yml to allow specifying source and target branches#15233

Open
tmat wants to merge 1 commit intomicrosoft:mainfrom
tmat:backmerge
Open

Refactor backmerge-release.yml to allow specifying source and target branches#15233
tmat wants to merge 1 commit intomicrosoft:mainfrom
tmat:backmerge

Conversation

@tmat
Copy link
Member

@tmat tmat commented Mar 13, 2026

Useful for keeping feature branches up-to-date.

Now that the workflow is more general should we rename to something like flow?

Copilot AI review requested due to automatic review settings March 13, 2026 22:38
@github-actions
Copy link
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15233

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15233"

@tmat
Copy link
Member Author

tmat commented Mar 13, 2026

@eerhardt ptal

Copy link
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

This PR generalizes the existing backmerge workflow so it can be manually triggered to merge an arbitrary source branch into an arbitrary target branch, rather than being hardcoded to release/13.2 -> main.

Changes:

  • Added workflow_dispatch inputs for source and target branches (with defaults).
  • Parameterized git fetch/merge logic and PR creation to use the provided branches.
  • Updated conflict-issue creation messaging to include the selected source/target branches.
Comments suppressed due to low confidence (1)

.github/workflows/backmerge-release.yml:152

  • The issue-deduping logic now becomes incorrect: it updates the first open backmerge-conflict issue regardless of which source/target pair is failing. With multiple branch pairs, conflicts will get conflated. Consider searching/filtering by source+target (e.g., in title/body) and only updating an issue that matches the current ${sourceBranch}/${targetBranch} pair; otherwise create a new one.
            // Check if there's already an open issue for this
            const existingIssues = await github.rest.issues.listForRepo({
              owner: context.repo.owner,
              repo: context.repo.repo,
              state: 'open',
              labels: 'backmerge-conflict',
              creator: 'github-actions[bot]'
            });

Comment on lines +53 to +54
git fetch origin "$TARGET_BRANCH" "$SOURCE_BRANCH"
BEHIND_COUNT=$(git rev-list --count "origin/$TARGET_BRANCH".."origin/$SOURCE_BRANCH")
**Commits to merge:** ${{ steps.check.outputs.behind_count }}

This PR was created automatically to keep \`main\` up-to-date with release branch changes.
This PR was created automatically to keep \`$TARGET_BRANCH\` up-to-date with release branch changes.
Comment on lines +30 to +32
env:
SOURCE_BRANCH: ${{ inputs.source || 'release/13.2' }}
TARGET_BRANCH: ${{ inputs.target || 'main' }}
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.

2 participants