fix(api): existing issue check
This commit is contained in:
parent
b8aad0921f
commit
e25d18adc9
@ -49,14 +49,16 @@ export default (server: FastifyInstance, _options: RouteShorthandOptions, done:
|
|||||||
const existingIssue = existingIssues.data.items[0];
|
const existingIssue = existingIssues.data.items[0];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (existingIssue?.state === 'closed') {
|
if (existingIssue) {
|
||||||
await octokit.request('PATCH /repos/{owner}/{repo}/issues/{issue_number}', {
|
if (existingIssue.state === 'closed') {
|
||||||
owner: environment.github.owner,
|
await octokit.request('PATCH /repos/{owner}/{repo}/issues/{issue_number}', {
|
||||||
repo: environment.github.repo,
|
owner: environment.github.owner,
|
||||||
issue_number: existingIssue.number,
|
repo: environment.github.repo,
|
||||||
labels: ['bug'],
|
issue_number: existingIssue.number,
|
||||||
state: 'open',
|
labels: ['bug'],
|
||||||
});
|
state: 'open',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await octokit.request('POST /repos/{owner}/{repo}/issues/{issue_number}/comments', {
|
await octokit.request('POST /repos/{owner}/{repo}/issues/{issue_number}/comments', {
|
||||||
owner: environment.github.owner,
|
owner: environment.github.owner,
|
||||||
|
Loading…
Reference in New Issue
Block a user