@@ -7,20 +7,31 @@ async function run() {
7
7
const image = core . getInput ( "image" , { required : true } ) ;
8
8
9
9
if ( ! imageExists ( image ) ) {
10
- core . setFailed ( `Image ${ image } does not exist in the local Docker daemon` ) ;
10
+ core . setFailed (
11
+ `Image ${ image } does not exist in the local Docker daemon` ,
12
+ ) ;
11
13
return ;
12
14
}
13
15
14
16
const blueprint = await getBlueprint ( project ) ;
15
17
16
18
if ( blueprint ?. project ?. container === undefined ) {
17
- core . warning ( `Project ${ project } does not have a container defined. Skipping publish` ) ;
19
+ core . warning (
20
+ `Project ${ project } does not have a container defined. Skipping publish` ,
21
+ ) ;
18
22
return ;
19
23
} else if ( blueprint ?. global ?. tagging ?. strategy === undefined ) {
20
- core . warning ( `The repository does not have a tagging strategy defined. Skipping publish` ) ;
24
+ core . warning (
25
+ `The repository does not have a tagging strategy defined. Skipping publish` ,
26
+ ) ;
21
27
return ;
22
- } else if ( blueprint ?. global ?. registry === undefined || blueprint ?. global ?. registry . length === 0 ) {
23
- core . warning ( `The repository does not have any registries defined. Skipping publish` ) ;
28
+ } else if (
29
+ blueprint ?. global ?. registry === undefined ||
30
+ blueprint ?. global ?. registry . length === 0
31
+ ) {
32
+ core . warning (
33
+ `The repository does not have any registries defined. Skipping publish` ,
34
+ ) ;
24
35
return ;
25
36
}
26
37
@@ -52,7 +63,9 @@ module.exports = {
52
63
* @returns {object } The blueprint object
53
64
*/
54
65
async function getBlueprint ( project ) {
55
- return JSON . parse ( await exec . getExecOutput ( "forge" , [ "blueprint" , "dump" , project ] ) ) ;
66
+ return JSON . parse (
67
+ await exec . getExecOutput ( "forge" , [ "blueprint" , "dump" , project ] ) ,
68
+ ) ;
56
69
}
57
70
58
71
/**
@@ -77,7 +90,7 @@ function getTag(strategy) {
77
90
* @return {boolean } True if the image exists, false otherwise
78
91
*/
79
92
async function imageExists ( name ) {
80
- ret = await exec . exec ( "docker" , [ "inspect" , name ] ) ;
93
+ const ret = await exec . exec ( "docker" , [ "inspect" , name ] ) ;
81
94
return ret === 0 ;
82
95
}
83
96
@@ -103,4 +116,4 @@ function strategyCommit() {
103
116
*/
104
117
async function tagImage ( oldImage , newImage ) {
105
118
await exec . exec ( "docker" , [ "tag" , oldImage , newImage ] ) ;
106
- }
119
+ }
0 commit comments