1
0
Fork 0

Correctly pull issue number for pull request review events (#311)

pull/320/head
Thomas Boop 2020-01-21 10:44:38 -05:00 committed by GitHub
parent 8b0300129f
commit a9175f3986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -52,10 +52,11 @@ describe('@actions/context', () => {
}) })
}) })
it('works with pullRequest payloads', () => { it('works with pull_request payloads', () => {
delete process.env.GITHUB_REPOSITORY delete process.env.GITHUB_REPOSITORY
context.payload = { context.payload = {
pullRequest: {number: 2}, // eslint-disable-next-line @typescript-eslint/camelcase
pull_request: {number: 2},
repository: {owner: {login: 'user'}, name: 'test'} repository: {owner: {login: 'user'}, name: 'test'}
} }
expect(context.issue).toEqual({ expect(context.issue).toEqual({

View File

@ -44,7 +44,7 @@ export class Context {
return { return {
...this.repo, ...this.repo,
number: (payload.issue || payload.pullRequest || payload).number number: (payload.issue || payload.pull_request || payload).number
} }
} }