File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/**
2- * Copyright 2020 ZeoFlow SRL
2+ * Copyright 2021 ZeoFlow SRL
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@ class AutoAssign {
3232 'pull_request.opened' ,
3333 'pull_request.ready_for_review' ,
3434 'pull_request.reopened' ,
35+ 'issues.opened' ,
3536 ]
3637 }
3738
@@ -60,6 +61,7 @@ class AutoAssign {
6061 const {
6162 zGithub,
6263 zPullRequest,
64+ zIssue,
6365
6466 zRepoOwner,
6567 zRepoName,
@@ -70,17 +72,24 @@ class AutoAssign {
7072 return
7173 }
7274
75+ let zContent = zPullRequest
76+ let isPr = true
77+ if ( zContent == null )
78+ {
79+ isPr = false
80+ zContent = zIssue
81+ }
7382 const owner = zRepoOwner
7483 const repo = zRepoName
7584 const {
7685 title,
7786 draft,
78- } = zPullRequest
87+ } = zContent
7988
8089 if ( skipKeywords && this . includesSkipKeywords ( title , skipKeywords ) ) {
8190 return
8291 }
83- if ( draft ) {
92+ if ( draft && isPr ) {
8493 return
8594 }
8695 if ( useReviewGroups && ! reviewGroups ) {
@@ -89,7 +98,7 @@ class AutoAssign {
8998 if ( useAssigneeGroups && ! assigneeGroups ) {
9099 return
91100 }
92- if ( addReviewers ) {
101+ if ( addReviewers && isPr ) {
93102 const { reviewers, team_reviewers} = this . chooseReviewers ( owner , zAutoAssign )
94103 if ( reviewers . length > 0 || team_reviewers . length > 0 ) {
95104 await pullsCreateReviewRequest ( zGithub , {
You can’t perform that action at this time.
0 commit comments