We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72ad1aa commit b4c740aCopy full SHA for b4c740a
.github/broken-link-checker/src/index.ts
@@ -80,8 +80,17 @@ const postComment = async (outputMd: string) => {
80
const { context, getOctokit } = github
81
const octokit = getOctokit(process.env.GITHUB_TOKEN!)
82
const { owner, repo } = context.repo
83
+ let prNumber
84
+
85
+ // Handle various trigger events
86
+ if (context.payload.pull_request) {
87
+ // Triggered by `pull_request`
88
+ prNumber = context.payload.pull_request?.number
89
+ } else if (context.payload.issue) {
90
+ // Triggered by `issue_comment`
91
+ prNumber = context.payload?.issue?.number
92
+ }
93
- const prNumber = context.payload?.issue?.number
94
if (!prNumber) {
95
setFailed("Count not find PR Number")
96
return ""
0 commit comments