Refactor backmerge-release.yml to allow specifying source and target branches#15233
Open
tmat wants to merge 1 commit intomicrosoft:mainfrom
Open
Refactor backmerge-release.yml to allow specifying source and target branches#15233tmat wants to merge 1 commit intomicrosoft:mainfrom
tmat wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15233Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15233" |
Member
Author
|
@eerhardt ptal |
Contributor
There was a problem hiding this comment.
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_dispatchinputs forsourceandtargetbranches (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-conflictissue 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' }} |
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.
Useful for keeping feature branches up-to-date.
Now that the workflow is more general should we rename to something like
flow?