Skip to content

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

Description

@thboop

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions