File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
.github/actions/surge-preview-tools/src Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 1
1
import core from "@actions/core" ;
2
2
import github from "@actions/github" ;
3
-
4
- const { checkLogin, getDeploys} = require ( "./surge-utils" ) ;
3
+ import { checkLogin , getDeploys } from "./surge-utils"
5
4
6
5
try {
7
6
const payload = github . context . payload ;
Original file line number Diff line number Diff line change @@ -5,22 +5,22 @@ import {execSync} from 'node:child_process'
5
5
6
6
const surgeCli = 'npx surge' ;
7
7
8
- function executeCmd ( command ) {
8
+ const executeCmd = command => {
9
9
const result = execSync ( command ) ;
10
10
return stripAnsi ( result . toString ( ) ) . trim ( ) ;
11
- }
11
+ } ;
12
12
13
- const checkLogin = ( surgeToken ) => {
13
+ export const checkLogin = ( surgeToken ) => {
14
14
try {
15
- executeCmd ( `${ surgeCli } list --token ${ surgeToken } ` ) ;
16
- return true ;
15
+ executeCmd ( `${ surgeCli } list --token ${ surgeToken } ` ) ;
16
+ return true ;
17
17
} catch ( e ) {
18
18
return false ;
19
19
}
20
- }
20
+ } ;
21
21
22
22
// Adapted here to pass the surge token
23
- function getDeploys ( surgeToken ) {
23
+ export const getDeploys = surgeToken => {
24
24
const surgeListOutput = executeCmd ( `${ surgeCli } list --token ${ surgeToken } ` ) ;
25
25
const lines =
26
26
surgeListOutput
@@ -40,7 +40,5 @@ function getDeploys(surgeToken) {
40
40
line
41
41
} ;
42
42
} ) ;
43
- }
43
+ } ;
44
44
45
- exports . getDeploys = getDeploys ;
46
- exports . checkLogin = checkLogin ;
You can’t perform that action at this time.
0 commit comments