Skip to content

Commit

Permalink
tolerate failure to post comment in PRs from forks
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
  • Loading branch information
jsoref committed Mar 8, 2024
1 parent 251c888 commit 666f366
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/coverage.yaml
Expand Up @@ -66,9 +66,13 @@ jobs:
const report = `### Coverage report
**Main**: ${main.toFixed(2)}% | **PR**: ${pr.toFixed(2)}% | **Diff: ${diff.toFixed(2)} ${diff >= 0 ? '✅' : '⚠️'}**`;
await core.summary.addRaw(report).write()
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: report
})
try {
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: report
})
} catch (e) {
console.log("Could not post comment to pull request", e)
}

0 comments on commit 666f366

Please sign in to comment.