Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Number does not populate correctly in @actions/github Context.issue #289

Closed
thboop opened this issue Jan 7, 2020 · 0 comments · Fixed by #311
Closed

Issue Number does not populate correctly in @actions/github Context.issue #289

thboop opened this issue Jan 7, 2020 · 0 comments · Fixed by #311
Assignees
Labels
bug Something isn't working

Comments

@thboop
Copy link
Collaborator

thboop commented Jan 7, 2020

Describe the bug
Issue number is empty for PullRequestReview and PullRequestReviewComment events

To Reproduce

  1. 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()
  1. Setup the workflow to run on on: [pull_request_review, pull_request_review_comment]
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant