Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

Commit 05e5ac8

Browse files
committed
console.log → core.info
1 parent ec149ec commit 05e5ac8

2 files changed

Lines changed: 32 additions & 56 deletions

File tree

dist/index.mjs

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42893,7 +42893,7 @@ function extractResolvedIssueKeys(prBody, comments) {
4289342893
* @return {Promise<Array<PullRequestComment>>}
4289442894
*/
4289542895
async function getPullRequestComments() {
42896-
console.log('Requesting pull request comments')
42896+
core.info('Requesting pull request comments')
4289742897

4289842898
return octokit.paginate(octokit.rest.issues.listComments, {
4289942899
owner: repoOwner,
@@ -42941,7 +42941,7 @@ async function nagToLinkJiraIssue(comments) {
4294142941
async function assignPrToIssues(issueKeys) {
4294242942
await Promise.all(
4294342943
issueKeys.map(async (issueKey) => {
42944-
console.log('Assigning PR', `#${pr.number}`, 'to issue', issueKey)
42944+
core.info(`Assigning PR #${pr.number} to issue ${issueKey}`)
4294542945

4294642946
const prLinkObject = {
4294742947
url: pr.html_url,
@@ -42966,13 +42966,7 @@ async function assignPrToIssues(issueKeys) {
4296642966
})
4296742967
)
4296842968

42969-
console.log(
42970-
'Assigned PR',
42971-
`#${pr.number}`,
42972-
'to',
42973-
issueKeys.length,
42974-
'issue(s)'
42975-
)
42969+
core.info(`Assigned PR #${pr.number} to ${issueKeys.length} issue(s)`)
4297642970
}
4297742971

4297842972
function escapeJqlString(str) {
@@ -42993,7 +42987,7 @@ async function getLastIssueInStatusKey(statusName) {
4299342987
},
4299442988
})
4299542989
const key = response.data.issues.at(0)?.key
42996-
console.log('Last issue in', statusName, 'is', key)
42990+
core.info(`Last issue in ${statusName} is ${key}`)
4299742991
return key
4299842992
}
4299942993

@@ -43036,11 +43030,8 @@ async function transitionIssues(issueKeys, newStatusNames) {
4303643030
await Promise.all(
4303743031
issues.map(async (issue) => {
4303843032
if (issue.currentStatusName === newStatusName) {
43039-
console.log(
43040-
'Did not transition',
43041-
issue.issueKey,
43042-
'— already in',
43043-
newStatusName
43033+
core.info(
43034+
`Did not transition ${issue.issueKey} — already in ${newStatusName}`
4304443035
)
4304543036
} else {
4304643037
const newStatusId =
@@ -43060,7 +43051,7 @@ async function transitionIssues(issueKeys, newStatusNames) {
4306043051
}
4306143052
)
4306243053

43063-
console.log('Transitioned', issue.issueKey, 'to', newStatusName)
43054+
core.info(`Transitioned ${issue.issueKey} to ${newStatusName}`)
4306443055

4306543056
return issue.issueKey
4306643057
}
@@ -43074,9 +43065,8 @@ async function transitionIssues(issueKeys, newStatusNames) {
4307443065
issues: transitionedIssueKeys,
4307543066
rankAfterIssue: lastIssueInStatusKey,
4307643067
})
43077-
console.log(
43078-
`Moved issues to the end of column '${newStatusName}':`,
43079-
...transitionedIssueKeys
43068+
core.info(
43069+
`Moved issues to the end of column '${newStatusName}': ${transitionedIssueKeys.join(', ')}`
4308043070
)
4308143071
}
4308243072
}
@@ -43098,10 +43088,10 @@ async function main() {
4309843088
void nagToLinkJiraIssue(comments)
4309943089
}
4310043090

43101-
console.log('Could not find issue IDs')
43091+
core.info('Could not find issue IDs')
4310243092
return
4310343093
}
43104-
console.log('Found issue IDs:', issueIds.join(', '))
43094+
core.info('Found issue IDs:', issueIds.join(', '))
4310543095

4310643096
// Treat PRs with “draft” or “wip” in brackets at the start or
4310743097
// end of the titles like drafts. Useful for orgs on unpaid
@@ -43116,33 +43106,31 @@ async function main() {
4311643106

4311743107
if (pr.state === 'open' && isDraft) {
4311843108
if (!jiraStatusPrDraft) {
43119-
console.log(
43109+
core.info(
4312043110
'No draft PR status name provided, skipping transitioning issues'
4312143111
)
4312243112
} else {
4312343113
await transitionIssues(issueIds, jiraStatusPrDraft.split('|'))
4312443114
}
4312543115
} else if (pr.state === 'open' && !isDraft) {
4312643116
if (!jiraStatusPrReady) {
43127-
console.log(
43117+
core.info(
4312843118
'No ready PR status name provided, skipping transitioning issues'
4312943119
)
4313043120
} else {
4313143121
await transitionIssues(issueIds, jiraStatusPrReady.split('|'))
4313243122
}
4313343123
} else if (pr.state === 'closed') {
4313443124
if (!jiraStatusPrMerged) {
43135-
console.log(
43125+
core.info(
4313643126
'No merged PR status name provided, skipping transitioning issues'
4313743127
)
4313843128
} else {
4313943129
await transitionIssues(issueIds, jiraStatusPrMerged.split('|'))
4314043130
}
4314143131
} else {
43142-
console.log(
43143-
'Skipping transitioning the issues:',
43144-
`pr.state=${pr.state},`,
43145-
pr.draft ? 'draft' : isFauxDraft ? 'faux draft' : 'not draft'
43132+
core.info(
43133+
`Skipping transitioning the issues: pr.state=${pr.state}, ${pr.draft ? 'draft' : isFauxDraft ? 'faux draft' : 'not draft'}`
4314643134
)
4314743135
}
4314843136
} catch (error) {

index.mjs

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function extractResolvedIssueKeys(prBody, comments) {
179179
* @return {Promise<Array<PullRequestComment>>}
180180
*/
181181
async function getPullRequestComments() {
182-
console.log('Requesting pull request comments')
182+
core.info('Requesting pull request comments')
183183

184184
return octokit.paginate(octokit.rest.issues.listComments, {
185185
owner: repoOwner,
@@ -227,7 +227,7 @@ async function nagToLinkJiraIssue(comments) {
227227
async function assignPrToIssues(issueKeys) {
228228
await Promise.all(
229229
issueKeys.map(async (issueKey) => {
230-
console.log('Assigning PR', `#${pr.number}`, 'to issue', issueKey)
230+
core.info(`Assigning PR #${pr.number} to issue ${issueKey}`)
231231

232232
const prLinkObject = {
233233
url: pr.html_url,
@@ -252,13 +252,7 @@ async function assignPrToIssues(issueKeys) {
252252
})
253253
)
254254

255-
console.log(
256-
'Assigned PR',
257-
`#${pr.number}`,
258-
'to',
259-
issueKeys.length,
260-
'issue(s)'
261-
)
255+
core.info(`Assigned PR #${pr.number} to ${issueKeys.length} issue(s)`)
262256
}
263257

264258
function escapeJqlString(str) {
@@ -279,7 +273,7 @@ async function getLastIssueInStatusKey(statusName) {
279273
},
280274
})
281275
const key = response.data.issues.at(0)?.key
282-
console.log('Last issue in', statusName, 'is', key)
276+
core.info(`Last issue in ${statusName} is ${key}`)
283277
return key
284278
}
285279

@@ -322,11 +316,8 @@ async function transitionIssues(issueKeys, newStatusNames) {
322316
await Promise.all(
323317
issues.map(async (issue) => {
324318
if (issue.currentStatusName === newStatusName) {
325-
console.log(
326-
'Did not transition',
327-
issue.issueKey,
328-
'— already in',
329-
newStatusName
319+
core.info(
320+
`Did not transition ${issue.issueKey} — already in ${newStatusName}`
330321
)
331322
} else {
332323
const newStatusId =
@@ -346,7 +337,7 @@ async function transitionIssues(issueKeys, newStatusNames) {
346337
}
347338
)
348339

349-
console.log('Transitioned', issue.issueKey, 'to', newStatusName)
340+
core.info(`Transitioned ${issue.issueKey} to ${newStatusName}`)
350341

351342
return issue.issueKey
352343
}
@@ -360,9 +351,8 @@ async function transitionIssues(issueKeys, newStatusNames) {
360351
issues: transitionedIssueKeys,
361352
rankAfterIssue: lastIssueInStatusKey,
362353
})
363-
console.log(
364-
`Moved issues to the end of column '${newStatusName}':`,
365-
...transitionedIssueKeys
354+
core.info(
355+
`Moved issues to the end of column '${newStatusName}': ${transitionedIssueKeys.join(', ')}`
366356
)
367357
}
368358
}
@@ -384,10 +374,10 @@ async function main() {
384374
void nagToLinkJiraIssue(comments)
385375
}
386376

387-
console.log('Could not find issue IDs')
377+
core.info('Could not find issue IDs')
388378
return
389379
}
390-
console.log('Found issue IDs:', issueIds.join(', '))
380+
core.info('Found issue IDs:', issueIds.join(', '))
391381

392382
// Treat PRs with “draft” or “wip” in brackets at the start or
393383
// end of the titles like drafts. Useful for orgs on unpaid
@@ -402,33 +392,31 @@ async function main() {
402392

403393
if (pr.state === 'open' && isDraft) {
404394
if (!jiraStatusPrDraft) {
405-
console.log(
395+
core.info(
406396
'No draft PR status name provided, skipping transitioning issues'
407397
)
408398
} else {
409399
await transitionIssues(issueIds, jiraStatusPrDraft.split('|'))
410400
}
411401
} else if (pr.state === 'open' && !isDraft) {
412402
if (!jiraStatusPrReady) {
413-
console.log(
403+
core.info(
414404
'No ready PR status name provided, skipping transitioning issues'
415405
)
416406
} else {
417407
await transitionIssues(issueIds, jiraStatusPrReady.split('|'))
418408
}
419409
} else if (pr.state === 'closed') {
420410
if (!jiraStatusPrMerged) {
421-
console.log(
411+
core.info(
422412
'No merged PR status name provided, skipping transitioning issues'
423413
)
424414
} else {
425415
await transitionIssues(issueIds, jiraStatusPrMerged.split('|'))
426416
}
427417
} else {
428-
console.log(
429-
'Skipping transitioning the issues:',
430-
`pr.state=${pr.state},`,
431-
pr.draft ? 'draft' : isFauxDraft ? 'faux draft' : 'not draft'
418+
core.info(
419+
`Skipping transitioning the issues: pr.state=${pr.state}, ${pr.draft ? 'draft' : isFauxDraft ? 'faux draft' : 'not draft'}`
432420
)
433421
}
434422
} catch (error) {

0 commit comments

Comments
 (0)