Skip to content

Commit

Permalink
chore: remove graduated preview header
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Jun 6, 2023
1 parent 8ebc35d commit 9433de6
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
Expand Down

0 comments on commit 9433de6

Please sign in to comment.