Show PR action when auto-merge is enabled

This commit is contained in:
Mohamed Boudra
2026-06-04 00:21:33 +07:00
parent eba8de6ab5
commit 6e8b7aaa07
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -342,6 +342,9 @@ function getPrimaryActionId(input: BuildGitActionsInput): GitActionId | null {
if (canEnablePrAutoMerge(input)) {
return getDefaultEnablePullRequestAutoMergeActionId(input);
}
if (hasEnabledPrAutoMerge(input)) {
return "pr";
}
if (!input.isOnBaseBranch && input.aheadCount > 0) {
return "merge-branch";
}
@@ -554,6 +557,16 @@ function canEnablePrAutoMerge(input: BuildGitActionsInput): boolean {
);
}
function hasEnabledPrAutoMerge(input: BuildGitActionsInput): boolean {
return (
input.githubFeaturesEnabled &&
input.hasPullRequest &&
input.pullRequestUrl !== null &&
hasPullRequestGithubFacts(input.pullRequestGithub) &&
input.pullRequestGithub.autoMergeRequest !== null
);
}
function getPullUnavailableMessage(input: BuildGitActionsInput): string | undefined {
if (!input.hasRemote) {
return "Pull isn't available here because this branch is not connected to a remote yet";