File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,15 @@ function _getBuildURL(inputs) {
17
17
18
18
function _getBranch ( inputs ) {
19
19
const { args } = inputs
20
+ if ( args . branch ) {
21
+ return args . branch
22
+ }
20
23
try {
21
24
const branchName = childprocess
22
25
. spawnSync ( 'git' , [ 'rev-parse' , '--abbrev-ref' , 'HEAD' ] )
23
26
. stdout . toString ( )
24
27
. trimRight ( )
25
- return args . branch || branchName
28
+ return branchName
26
29
} catch ( error ) {
27
30
throw new Error (
28
31
`There was an error getting the branch name from git: ${ error } ` ,
@@ -53,12 +56,15 @@ function getServiceName() {
53
56
54
57
function _getSHA ( inputs ) {
55
58
const { args } = inputs
59
+ if ( args . sha ) {
60
+ return args . sha
61
+ }
56
62
try {
57
63
const sha = childprocess
58
64
. spawnSync ( 'git' , [ 'rev-parse' , 'HEAD' ] )
59
65
. stdout . toString ( )
60
66
. trimRight ( )
61
- return args . sha || sha
67
+ return sha
62
68
} catch ( error ) {
63
69
throw new Error (
64
70
`There was an error getting the commit SHA from git: ${ error } ` ,
@@ -68,12 +74,15 @@ function _getSHA(inputs) {
68
74
69
75
function _getSlug ( inputs ) {
70
76
const { args } = inputs
77
+ if ( args . slug ) {
78
+ return args . slug
79
+ }
71
80
try {
72
81
const slug = childprocess
73
82
. spawnSync ( 'git' , [ 'config' , '--get' , 'remote.origin.url' ] )
74
83
. stdout . toString ( )
75
84
. trimRight ( )
76
- return args . slug || parseSlug ( slug )
85
+ return parseSlug ( slug )
77
86
} catch ( error ) {
78
87
throw new Error ( `There was an error getting the slug from git: ${ error } ` )
79
88
}
You can’t perform that action at this time.
0 commit comments