Skip to content

Commit 86b0007

Browse files
feat: consider pull_request_target event (#291)
1 parent e65981b commit 86b0007

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

__tests__/context-helper.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,18 @@ describe('isPush', () => {
3939
});
4040

4141
describe('isPr', () => {
42-
it('should return true', () => {
42+
it('should return true 1', () => {
4343
expect(isPr(getContext({
4444
eventName: 'pull_request',
4545
}))).toBe(true);
4646
});
4747

48+
it('should return true 2', () => {
49+
expect(isPr(getContext({
50+
eventName: 'pull_request_target',
51+
}))).toBe(true);
52+
});
53+
4854
it('should return false', () => {
4955
expect(isPr(getContext({
5056
eventName: 'release',

src/context-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const isRelease = (context: Context): boolean => 'release' === context.ev
77

88
export const isPush = (context: Context): boolean => 'push' === context.eventName;
99

10-
export const isPr = (context: Context): boolean => 'pull_request' === context.eventName;
10+
export const isPr = (context: Context): boolean => 'pull_request' === context.eventName || 'pull_request_target' === context.eventName;
1111

1212
export const isIssue = (context: Context): boolean => 'issues' === context.eventName;
1313

0 commit comments

Comments
 (0)