Skip to content

Commit

Permalink
Disable warning
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 2, 2021
1 parent b3c340f commit e387d1f
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/backport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,6 @@ const getBackportBaseToHead = ({
return baseToHead;
};

const warnIfSquashIsNotTheOnlyAllowedMergeMethod = async ({
github,
owner,
repo,
}: {
github: InstanceType<typeof GitHub>;
owner: string;
repo: string;
}) => {
const {
data: { allow_merge_commit, allow_rebase_merge },
} = await github.repos.get({ owner, repo });
if (allow_merge_commit || allow_rebase_merge) {
warning(
[
"Your repository allows merge commits and rebase merging.",
" However, Backport only supports rebased and merged pull requests with a single commit and squashed and merged pull requests.",
" Consider only allowing squash merging.",
" See https://help.github.com/en/github/administering-a-repository/about-merge-methods-on-github for more information.",
].join("\n"),
);
}
};

const backportOnce = async ({
base,
body,
Expand Down Expand Up @@ -238,8 +214,6 @@ const backport = async ({

const github = getOctokit(token);

await warnIfSquashIsNotTheOnlyAllowedMergeMethod({ github, owner, repo });

const commitsResponse = await github.request(
"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits",
{
Expand Down

0 comments on commit e387d1f

Please sign in to comment.