Skip to content

Commit

Permalink
Correctly pull issue number for pull request review events (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
thboop authored Jan 21, 2020
1 parent 8b03001 commit a9175f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/github/__tests__/lib.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ describe('@actions/context', () => {
})
})

it('works with pullRequest payloads', () => {
it('works with pull_request payloads', () => {
delete process.env.GITHUB_REPOSITORY
context.payload = {
pullRequest: {number: 2},
// eslint-disable-next-line @typescript-eslint/camelcase
pull_request: {number: 2},
repository: {owner: {login: 'user'}, name: 'test'}
}
expect(context.issue).toEqual({
Expand Down
2 changes: 1 addition & 1 deletion packages/github/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Context {

return {
...this.repo,
number: (payload.issue || payload.pullRequest || payload).number
number: (payload.issue || payload.pull_request || payload).number
}
}

Expand Down

0 comments on commit a9175f3

Please sign in to comment.