Skip to content

Commit 2b8c69a

Browse files
committed
Fixes undefined fields
1 parent 34091c5 commit 2b8c69a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/checkForHttpStatusCodesUpdate.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ const issueTitleBase = 'IANA HTTP Status Code Update';
5959

6060
const searchForExistingGithubIssue = async ( { lastUpdatedDate, github, context } ) => {
6161
const query = [ issueTitleBase, lastUpdatedDate, 'in:title', `repo:${context.payload.repository.full_name}`, 'type:issue' ].join( '+' );
62-
const searchResult = await github.search.issuesAndPullRequests( {
62+
const searchResponse = await github.search.issuesAndPullRequests( {
6363
q: query,
6464
} );
65-
return searchResult.data;
65+
return searchResponse.data;
6666
};
6767

6868
const createNewGithubIssue = async ( { httpStatusCodes, diffWithLastUsedVersion, github, context, dryRun } ) => {
6969

7070
const newIssue = {
7171
owner: context.repo.owner,
7272
repo: context.repo.repo,
73-
title: `${issueTitleBase} ${httpStatusCodes.lastUpdatedDate}`,
73+
title: `${issueTitleBase} ${httpStatusCodes.lastUpdated}`,
7474
body: `The HTTP status codes list has been updated on ${httpStatusCodes.lastUpdated}. ` + '\n' +
7575
'See https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml' + '\n\n' +
7676
'## Diff ##' + '\n' +
@@ -84,7 +84,8 @@ const createNewGithubIssue = async ( { httpStatusCodes, diffWithLastUsedVersion,
8484
return { number: 0, html_url: context.payload.repository.issues_url };
8585
}
8686

87-
return github.issues.create( newIssue );
87+
const issueResponse = await github.issues.create( newIssue );
88+
return issueResponse.data;
8889
};
8990

9091
const getDiffWithLastUsedVersion = async ( httpStatusCodeList ) => {

0 commit comments

Comments
 (0)