Skip to content

Commit

Permalink
- do not fail on missing issue number
Browse files Browse the repository at this point in the history
  - FIX #1178
  • Loading branch information
mikepenz committed Sep 13, 2024
1 parent 2e33034 commit 568c6f5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/annotator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ export async function attachComment(
detailsTable: SummaryTableRow[],
flakySummary: SummaryTableRow[]
): Promise<void> {
if (!context.issue.number) {
core.warning(`⚠️ Action requires a valid issue number (PR reference) to be able to attach a comment..`)
return
}

const identifier = buildCommentIdentifier(checkName)

let comment = buildTable(table)
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export async function run(): Promise<void> {

if (comment) {
const octokit: InstanceType<typeof GitHub> = github.getOctokit(token)
attachComment(octokit, checkName, updateComment, table, detailTable, flakyTable)
await attachComment(octokit, checkName, updateComment, table, detailTable, flakyTable)
}

core.setOutput('summary', buildTable(table))
Expand Down

0 comments on commit 568c6f5

Please sign in to comment.