Skip to content

Commit abfd2db

Browse files
committed
Update README
1 parent 553b4d1 commit abfd2db

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,31 @@ function github_issues_githubapi_payload($event_name, $record, $repo){
5050

5151
switch ($event_name) {
5252
case 'push':
53-
foreach($record['data']->commits as $commit){
53+
foreach($payload['data']['commits'] as $commit){
5454
$match = NULL;
5555
$message = '';
56-
preg_match_all($expr, $commit->message, $match);
56+
preg_match_all($expr, $commit['message'], $match);
5757
if(!empty($match[1])){
5858
foreach($match[1] as $issue){
5959
$message .= GITHUB_ISSUES_ISSUES_REPO . '#' . $issue . " ";
6060
}
6161
if(!empty($message)){
62-
github_issues_commit_comment_add($commit->id, $message, $repo);
62+
borg_github_issues_commit_comment_add($commit['id'], $message, $repo);
6363
}
6464
}
6565
}
6666
break;
6767
case 'pull_request':
68-
if($record['data']->action == 'opened'){
68+
if($payload['data']['action'] == 'opened'){
6969
$message = '';
70-
preg_match_all($expr, $record['data']->pull_request->title . ' ' . $record['data']->pull_request->body, $match);
70+
preg_match_all($expr, $payload['data']['pull_request']['title'] . ' ' . $payload['pull_request']['body'], $match);
7171
if(!empty($match[1])){
7272
foreach($match[1] as $issue){
7373
$message .= GITHUB_ISSUES_ISSUES_REPO . '#' . $issue . " ";
7474
}
75-
75+
7676
if(!empty($message)){
77-
github_issues_issue_comment_add($record['data']->number, $message, $repo);
77+
borg_github_issues_issue_comment_add($payload['number'], $message, $repo);
7878
}
7979
}
8080
}

0 commit comments

Comments
 (0)