@@ -975,22 +975,20 @@ class GitHubHelper {
975
975
const headBranch = `${ headOwner } :${ inputs . branch } ` ;
976
976
// Create or update the pull request
977
977
const pull = yield this . createOrUpdate ( inputs , baseRepository , headBranch ) ;
978
- // Set milestone, labels and assignees
979
- const updateIssueParams = { } ;
978
+ // Apply milestone
980
979
if ( inputs . milestone ) {
981
- updateIssueParams [ 'milestone' ] = inputs . milestone ;
982
980
core . info ( `Applying milestone '${ inputs . milestone } '` ) ;
981
+ yield this . octokit . issues . update ( Object . assign ( Object . assign ( { } , this . parseRepository ( baseRepository ) ) , { issue_number : pull . number , milestone : inputs . milestone } ) ) ;
983
982
}
983
+ // Apply labels
984
984
if ( inputs . labels . length > 0 ) {
985
- updateIssueParams [ 'labels' ] = inputs . labels ;
986
985
core . info ( `Applying labels '${ inputs . labels } '` ) ;
986
+ yield this . octokit . issues . addLabels ( Object . assign ( Object . assign ( { } , this . parseRepository ( baseRepository ) ) , { issue_number : pull . number , labels : inputs . labels } ) ) ;
987
987
}
988
+ // Apply assignees
988
989
if ( inputs . assignees . length > 0 ) {
989
- updateIssueParams [ 'assignees' ] = inputs . assignees ;
990
990
core . info ( `Applying assignees '${ inputs . assignees } '` ) ;
991
- }
992
- if ( Object . keys ( updateIssueParams ) . length > 0 ) {
993
- yield this . octokit . issues . update ( Object . assign ( Object . assign ( Object . assign ( { } , this . parseRepository ( baseRepository ) ) , { issue_number : pull . number } ) , updateIssueParams ) ) ;
991
+ yield this . octokit . issues . addAssignees ( Object . assign ( Object . assign ( { } , this . parseRepository ( baseRepository ) ) , { issue_number : pull . number , labels : inputs . assignees } ) ) ;
994
992
}
995
993
// Request reviewers and team reviewers
996
994
const requestReviewersParams = { } ;
0 commit comments