diff --git a/package.json b/package.json index 41e353f..d938885 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "backport", - "version": "2.0.7", + "version": "2.0.8", "license": "MIT", "main": "dist/index.js", "files": [ diff --git a/src/backport.ts b/src/backport.ts index 8ed7156..30e7723 100644 --- a/src/backport.ts +++ b/src/backport.ts @@ -8,6 +8,7 @@ import type { } from "@octokit/webhooks-types"; import ensureError from "ensure-error"; import { compact } from "lodash-es"; +import { stripTestPlanFromPRBody } from "./utils.js"; const getBaseBranchFromLabel = ( label: string, @@ -301,7 +302,7 @@ const backport = async ({ for (const base of baseBranches) { const body = getBody({ base, - body: originalBody ?? "", + body: originalBody ? stripTestPlanFromPRBody(originalBody) : "", mergeCommitSha, number, }); diff --git a/src/index.ts b/src/index.ts index bc3c1db..6c27614 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ const run = async () => { } const payload = context.payload as PullRequestEvent; - const runId = context.runId; + const runId = context.runId; const serverUrl = context.serverUrl; if (payload.action !== "closed" && payload.action !== "labeled") { @@ -31,7 +31,7 @@ const run = async () => { `Unsupported pull request event action: ${payload.action}.`, ); } - + const createdPullRequestBaseBranchToNumber = await backport({ getBody, getHead, diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..475e242 --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,2 @@ +export const stripTestPlanFromPRBody = (body: string): string => + body.replace(//g, "");