1
- import * as core from ' @actions/core' ;
2
- import { installCli } from ' ./steps/installCli' ;
3
- import { runChecksJson } from ' ./steps/runChecksJson' ;
4
- import { runChecksText } from ' ./steps/runChecksText' ;
5
- import { getConfigContents } from ' ./steps/getConfigContents' ;
6
- import { getFileDiff } from ' ./steps/getFileDiff' ;
7
- import { addAnnotations } from ' ./addAnnotations' ;
8
- import * as semver from ' semver' ;
1
+ import * as core from " @actions/core" ;
2
+ import { installCli } from " ./steps/installCli" ;
3
+ import { runChecksJson } from " ./steps/runChecksJson" ;
4
+ import { runChecksText } from " ./steps/runChecksText" ;
5
+ import { getConfigContents } from " ./steps/getConfigContents" ;
6
+ import { getFileDiff } from " ./steps/getFileDiff" ;
7
+ import { addAnnotations } from " ./addAnnotations" ;
8
+ import * as semver from " semver" ;
9
9
10
10
async function run ( ) {
11
11
const cwd = process . cwd ( ) ;
12
12
const shopifyExecutable = `${ cwd } /node_modules/.bin/shopify` ;
13
13
14
14
// This is mockable with process.env.INPUT_ALL_CAPS_NAME
15
- const themeRoot = core . getInput ( ' theme_root' ) || cwd ;
16
- const version = core . getInput ( ' version' ) || '' ;
17
- const flags = core . getInput ( ' flags' ) || '' ;
18
- const ghToken = core . getInput ( ' token' ) ;
19
- const base = core . getInput ( ' base' ) ;
15
+ const themeRoot = core . getInput ( " theme_root" ) || cwd ;
16
+ const version = core . getInput ( " version" ) || "" ;
17
+ const flags = core . getInput ( " flags" ) || "" ;
18
+ const ghToken = core . getInput ( " token" ) ;
19
+ const base = core . getInput ( " base" ) ;
20
20
const devPreview = requiresDevPreview ( version ) ;
21
21
22
22
try {
23
23
await installCli ( version ) ;
24
24
if ( ghToken ) {
25
- const [ { report, exitCode } , configContent , fileDiff ] =
26
- await Promise . all ( [
27
- runChecksJson (
28
- themeRoot ,
29
- shopifyExecutable ,
30
- devPreview ,
31
- flags ,
32
- ) ,
25
+ const [ { report, exitCode } , configContent , fileDiff ] = await Promise . all (
26
+ [
27
+ runChecksJson ( themeRoot , shopifyExecutable , devPreview , flags ) ,
33
28
getConfigContents ( themeRoot , shopifyExecutable , devPreview ) ,
34
29
getFileDiff ( base , cwd ) ,
35
- ] ) ;
36
- await addAnnotations (
37
- report ,
38
- exitCode ,
39
- configContent ,
40
- ghToken ,
41
- fileDiff ,
30
+ ]
42
31
) ;
32
+ await addAnnotations ( report , exitCode , configContent , ghToken , fileDiff ) ;
43
33
process . exit ( exitCode ) ;
44
34
} else {
45
35
const { exitCode } = await runChecksText (
46
36
themeRoot ,
47
37
shopifyExecutable ,
48
38
devPreview ,
49
- flags ,
39
+ flags
50
40
) ;
51
41
process . exit ( exitCode ) ;
52
42
}
@@ -58,9 +48,7 @@ async function run() {
58
48
59
49
function requiresDevPreview ( version : string ) {
60
50
return (
61
- ! ! version &&
62
- semver . gte ( version , '3.50.0' ) &&
63
- semver . lt ( version , '3.55.0' )
51
+ ! ! version && semver . gte ( version , "3.50.0" ) && semver . lt ( version , "3.55.0" )
64
52
) ;
65
53
}
66
54
0 commit comments