Describe the bug
Issue number is empty for PullRequestReview and PullRequestReviewComment events
To Reproduce
- Create an action using the following ts file:
import * as core from '@actions/core'
import * as github from '@actions/github'
async function run(): Promise<void> {
try {
core.info(`Issue number is: ${JSON.stringify(github.context.issue.number)}`)
} catch (error) {
core.setFailed(error.message)
}
}
run()
- Setup the workflow to run on
on: [pull_request_review, pull_request_review_comment]
- Create a PR with a linked issue
Expected behavior
The Issue number field should be populated.
Screenshots
The issue number field is null.
Additional context
We appear to be accessing pullRequest instead of pull_request causing this bug:
https://github.com/actions/toolkit/blob/master/packages/github/src/context.ts#L47
Describe the bug
Issue number is empty for PullRequestReview and PullRequestReviewComment events
To Reproduce
on: [pull_request_review, pull_request_review_comment]Expected behavior
The Issue number field should be populated.
Screenshots
The issue number field is null.
Additional context
We appear to be accessing
pullRequestinstead ofpull_requestcausing this bug:https://github.com/actions/toolkit/blob/master/packages/github/src/context.ts#L47