Skip to content

Commit 3ce18a7

Browse files
committed
fixup! feat(ng-dev): add auto merge strategy for pull requests
1 parent 069efb2 commit 3ce18a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ng-dev/pr/merge/strategies/api-merge.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {FatalMergeToolError, MergeConflictsFatalError} from '../failures.js';
1717
import {Prompt} from '../../../utils/prompt.js';
1818
import {AutosquashMergeStrategy} from './autosquash-merge.js';
1919
import {Commit, parseCommitMessage} from '../../../commit-message/parse.js';
20+
import {TEMP_PR_HEAD_BRANCH} from './strategy.js';
2021

2122
/** Type describing the parameters for the Octokit `merge` API endpoint. */
2223
type OctokitMergeParams = RestEndpointMethodTypes['pulls']['merge']['parameters'];
@@ -154,6 +155,11 @@ export class GithubApiMergeStrategy extends AutosquashMergeStrategy {
154155
);
155156
}
156157

158+
// Workaround for fatal: refusing to fetch into branch 'refs/heads/merge_pr_target_main' checked out at ...
159+
// Cannot find where but `merge_pr_target_main` is being set as the current branch.
160+
// TODO: remove after finding the root cause.
161+
this.git.run(['checkout', TEMP_PR_HEAD_BRANCH]);
162+
157163
// Refresh the target branch the PR has been merged into through the API. We need
158164
// to re-fetch as otherwise we cannot cherry-pick the new commits into the remaining
159165
// target branches. Also, this is needed fo the merge comment to get the correct commit SHA.

0 commit comments

Comments
 (0)