Skip to content

Commit 2488a2b

Browse files
committed
jenkins: parse PR number into a number while extracting from git ref
Primarily done because the GraphQL client validation done when fetching existing bot comments, exploded because an invalid `Int!` value was provided: ``` 00:42:03.038Z ERROR bot: Error while creating comment on GitHub (req_id=baae5340-8be1-11e9-a4d0-856e0a231c31) GraphqlError: Variable number of type Int! was provided invalid value at request.then.response (/home/../node_modules/@octokit/graphql/lib/graphql.js:31:15) ``` Doing an explicit `string -> number` convertion when extracting the PR number from the related git ref hopefully fixes this error, since it *should* be a valid `Int!` now.
1 parent 98f7322 commit 2488a2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/push-jenkins-update.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function pushEnded (options, build, cb) {
7878

7979
function findPrInRef (gitRef) {
8080
// refs/pull/12345/head
81-
return gitRef.split('/')[2]
81+
return parseInt(gitRef.split('/')[2], 10)
8282
}
8383

8484
function findLatestCommitInPr (options, cb, pageNumber = 1) {

0 commit comments

Comments
 (0)