From a7bb76508d49edcde4c592563a3f61cbd8586633 Mon Sep 17 00:00:00 2001
From: Peter Evans <18365890+peter-evans@users.noreply.github.com>
Date: Wed, 23 Feb 2022 15:34:53 +0900
Subject: [PATCH] fix: remove unused draft param from pull update (#1065)

---
 dist/index.js        |  2 +-
 package-lock.json    | 44 ++++++++++++++++++++++----------------------
 src/github-helper.ts |  3 +--
 3 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/dist/index.js b/dist/index.js
index 77ba7a1..f4a2a38 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -966,7 +966,7 @@ class GitHubHelper {
             core.info(`Fetching existing pull request`);
             const { data: pulls } = yield this.octokit.rest.pulls.list(Object.assign(Object.assign({}, this.parseRepository(baseRepository)), { state: 'open', head: headBranch, base: inputs.base }));
             core.info(`Attempting update of pull request`);
-            const { data: pull } = yield this.octokit.rest.pulls.update(Object.assign(Object.assign({}, this.parseRepository(baseRepository)), { pull_number: pulls[0].number, title: inputs.title, body: inputs.body, draft: inputs.draft }));
+            const { data: pull } = yield this.octokit.rest.pulls.update(Object.assign(Object.assign({}, this.parseRepository(baseRepository)), { pull_number: pulls[0].number, title: inputs.title, body: inputs.body }));
             core.info(`Updated pull request #${pull.number} (${headBranch} => ${inputs.base})`);
             return {
                 number: pull.number,
diff --git a/package-lock.json b/package-lock.json
index 3bea319..9ff13ec 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,30 +9,30 @@
       "version": "3.0.0",
       "license": "MIT",
       "dependencies": {
-        "@actions/core": "1.6.0",
-        "@actions/exec": "1.1.0",
-        "@octokit/core": "3.5.1",
-        "@octokit/plugin-paginate-rest": "2.17.0",
-        "@octokit/plugin-rest-endpoint-methods": "5.13.0",
-        "https-proxy-agent": "5.0.0",
-        "uuid": "8.3.2"
+        "@actions/core": "^1.6.0",
+        "@actions/exec": "^1.1.0",
+        "@octokit/core": "^3.5.1",
+        "@octokit/plugin-paginate-rest": "^2.17.0",
+        "@octokit/plugin-rest-endpoint-methods": "^5.13.0",
+        "https-proxy-agent": "^5.0.0",
+        "uuid": "^8.3.2"
       },
       "devDependencies": {
-        "@types/jest": "27.0.3",
-        "@types/node": "16.11.11",
-        "@typescript-eslint/parser": "5.5.0",
-        "@vercel/ncc": "0.32.0",
-        "eslint": "8.3.0",
-        "eslint-import-resolver-typescript": "2.5.0",
-        "eslint-plugin-github": "4.3.5",
-        "eslint-plugin-import": "2.25.3",
-        "eslint-plugin-jest": "25.3.0",
-        "jest": "27.4.3",
-        "jest-circus": "27.4.2",
-        "js-yaml": "4.1.0",
-        "prettier": "2.5.0",
-        "ts-jest": "27.0.7",
-        "typescript": "4.5.2"
+        "@types/jest": "^27.0.3",
+        "@types/node": "^16.11.11",
+        "@typescript-eslint/parser": "^5.5.0",
+        "@vercel/ncc": "^0.32.0",
+        "eslint": "^8.3.0",
+        "eslint-import-resolver-typescript": "^2.5.0",
+        "eslint-plugin-github": "^4.3.5",
+        "eslint-plugin-import": "^2.25.3",
+        "eslint-plugin-jest": "^25.3.0",
+        "jest": "^27.4.3",
+        "jest-circus": "^27.4.2",
+        "js-yaml": "^4.1.0",
+        "prettier": "^2.5.0",
+        "ts-jest": "^27.0.7",
+        "typescript": "^4.5.2"
       }
     },
     "node_modules/@actions/core": {
diff --git a/src/github-helper.ts b/src/github-helper.ts
index d0f9a6f..35db3e8 100644
--- a/src/github-helper.ts
+++ b/src/github-helper.ts
@@ -84,8 +84,7 @@ export class GitHubHelper {
       ...this.parseRepository(baseRepository),
       pull_number: pulls[0].number,
       title: inputs.title,
-      body: inputs.body,
-      draft: inputs.draft
+      body: inputs.body
     })
     core.info(
       `Updated pull request #${pull.number} (${headBranch} => ${inputs.base})`