From 9433de6dd574533a976743911009d1cc4b75cd0d Mon Sep 17 00:00:00 2001 From: dessant Date: Tue, 6 Jun 2023 21:01:40 +0300 Subject: [PATCH] chore: remove graduated preview header --- src/index.js | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/index.js b/src/index.js index 9308c11..b5fb23b 100644 --- a/src/index.js +++ b/src/index.js @@ -229,15 +229,12 @@ class App { }); } else { const params = {...issue}; + const lockReason = actions['lock-reason']; if (lockReason) { - Object.assign(params, { - lock_reason: lockReason, - headers: { - Accept: 'application/vnd.github.sailor-v-preview+json' - } - }); + params.lock_reason = lockReason; } + await this.client.rest.issues.lock(params); } } @@ -282,12 +279,7 @@ class App { if (lock.active) { if (issue) { if (!lock.hasOwnProperty('reason')) { - const {data: issueData} = await this.client.rest.issues.get({ - ...issue, - headers: { - Accept: 'application/vnd.github.sailor-v-preview+json' - } - }); + const {data: issueData} = await this.client.rest.issues.get(issue); lock.reason = issueData.active_lock_reason; } @@ -308,13 +300,7 @@ class App { if (lock.restoreLock) { if (issue) { if (lock.reason) { - issue = { - ...issue, - lock_reason: lock.reason, - headers: { - Accept: 'application/vnd.github.sailor-v-preview+json' - } - }; + issue = {...issue, lock_reason: lock.reason}; } await this.client.rest.issues.lock(issue);