@@ -23,7 +23,7 @@ module.exports = async ({ github, context, versionType }) => {
23
23
}
24
24
25
25
async function getPull ( source , target ) {
26
- const existingPr = await github . rest . pulls . list ( {
26
+ const existingPr = await github . pulls . list ( {
27
27
owner : context . repo . owner ,
28
28
repo : context . repo . repo ,
29
29
head : source ,
@@ -33,19 +33,14 @@ module.exports = async ({ github, context, versionType }) => {
33
33
}
34
34
35
35
async function createPull ( title , source , target ) {
36
- try {
37
- await github . pulls . create ( {
38
- title,
39
- body : `${ title } PR.` ,
40
- owner : context . repo . owner ,
41
- repo : context . repo . repo ,
42
- head : source ,
43
- base : target ,
44
- } ) ;
45
- console . log ( `Created pull request: ${ title } .` ) ;
46
- } catch ( error ) {
47
- console . error ( error . errors ) ;
48
- }
36
+ await github . pulls . create ( {
37
+ title,
38
+ body : `${ title } PR.` ,
39
+ owner : context . repo . owner ,
40
+ repo : context . repo . repo ,
41
+ head : source ,
42
+ base : target ,
43
+ } ) ;
49
44
}
50
45
51
46
try {
@@ -65,6 +60,6 @@ module.exports = async ({ github, context, versionType }) => {
65
60
throw new Error ( "Pull request already exists for this version increment" ) ;
66
61
}
67
62
} catch ( error ) {
68
- throw new Error ( "Error in version increment and PR creation: " , error ) ;
63
+ throw new Error ( "Error in version increment and PR creation" , error ) ;
69
64
}
70
65
} ;
0 commit comments