Skip to content

Fix inter-branch merge workflow ResetToTargetPaths functionality#16395

Merged
mmitche merged 4 commits intomainfrom
copilot/fix-inter-branch-merge-workflow
Dec 12, 2025
Merged

Fix inter-branch merge workflow ResetToTargetPaths functionality#16395
mmitche merged 4 commits intomainfrom
copilot/fix-inter-branch-merge-workflow

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

The ResetToTargetPaths feature in the inter-branch merge workflow had three issues: commits failed due to missing git identity, git ls-tree doesn't support wildcards/globs, and each pattern created a separate commit.

Changes

  • Git identity: Configure github-actions[bot] user before committing to prevent authentication failures
  • Pattern matching: Remove git ls-tree check and use git checkout directly, which natively handles wildcards and glob patterns
  • Single commit: Accumulate all pattern checkouts, then create one commit listing all patterns (each on a separate line) instead of multiple commits

Example

With patterns ["*.txt", "docs/**/*.md"], the workflow now produces:

Reset files to main

Reset patterns:
- *.txt
- docs/**/*.md

Instead of two separate commits with individual pattern names.

To double check:

Original prompt

This section details on the original issue you should resolve

<issue_title>Issues to fix in inter-branch merge workflow</issue_title>
<issue_description>- When ResetToTargetPaths is used in the inter-branch merge workflow, the commit step will fail because there is no configured user name and email when running the workflow. This should be fixed and a github bot user and noreply emails should be used.

  • There should be no test for whether paths to reset exists before doing the reset. ls-tree does not take wildcards or glob patterns. Instead, just check out each path.
  • There should be a single commit for all resets. The commit should list what patterns were used for the reset.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 10, 2025 15:31
- Configure git user (github-actions bot) before commits
- Remove ls-tree check that doesn't work with wildcards
- Create single commit for all reset patterns with comprehensive message

Co-authored-by: mmitche <[email protected]>
- Remove extra quotes around pattern list
- Add check to ensure patterns were processed before committing

Co-authored-by: mmitche <[email protected]>
Copilot AI changed the title [WIP] Fix issues in inter-branch merge workflow Fix inter-branch merge workflow ResetToTargetPaths functionality Dec 10, 2025
Copilot AI requested a review from mmitche December 10, 2025 15:37
Each pattern now appears on its own line with a bullet point for better readability.

Co-authored-by: mmitche <[email protected]>
Copilot AI requested a review from mmitche December 10, 2025 16:21
@mmitche mmitche marked this pull request as ready for review December 10, 2025 16:28
@mmitche mmitche requested a review from ViktorHofer December 10, 2025 16:28
@mmitche mmitche merged commit 2744f99 into main Dec 12, 2025
2 of 4 checks passed
@mmitche mmitche deleted the copilot/fix-inter-branch-merge-workflow branch December 12, 2025 16:43
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.

Issues to fix in inter-branch merge workflow

3 participants