Skip to content

Commit 509552a

Browse files
feat: add prMerged flag to webhook result (#243)
1 parent 52a8125 commit 509552a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,7 @@ class GithubScm extends Scm {
15571557
const prTitle = hoek.reach(webhookPayload, 'pull_request.title');
15581558
const baseSource = hoek.reach(webhookPayload, 'pull_request.base.repo.id');
15591559
const headSource = hoek.reach(webhookPayload, 'pull_request.head.repo.id');
1560+
const prMerged = hoek.reach(webhookPayload, 'pull_request.merged');
15601561
const prSource = baseSource === headSource ? 'branch' : 'fork';
15611562
const ref = `pull/${prNum}/merge`;
15621563

@@ -1584,7 +1585,8 @@ class GithubScm extends Scm {
15841585
type: 'pr',
15851586
username: hoek.reach(webhookPayload, 'sender.login'),
15861587
hookId,
1587-
scmContext
1588+
scmContext,
1589+
prMerged
15881590
};
15891591
}
15901592
case 'push': {

test/index.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,8 @@ jobs:
17411741
type: 'pr',
17421742
username: 'baxterthehacker2',
17431743
hookId: '3c77bf80-9a2f-11e6-80d6-72f7fe03ea29',
1744-
scmContext: 'github:github.com'
1744+
scmContext: 'github:github.com',
1745+
prMerged: false
17451746
};
17461747

17471748
testHeaders = {

0 commit comments

Comments
 (0)