mirror of https://github.com/actions/toolkit
Correctly pull issue number for pull request review events (#311)
parent
8b0300129f
commit
a9175f3986
|
@ -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({
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue