33// https://github.com/actions/javascript-action
44// https://github.com/actions/toolkit/blob/master/docs/action-debugging.md
55
6- import fs from 'fs' ;
7- import path from 'path' ;
6+ import fs from 'node: fs' ;
7+ import path from 'node: path' ;
88import { DefaultArtifactClient } from '@actions/artifact' ;
99import * as core from '@actions/core' ;
10- import * as io from '@actions/io' ;
1110import * as exec from '@actions/exec' ;
11+ import * as glob from '@actions/glob' ;
1212import { HttpClient } from '@actions/http-client' ;
13+ import * as io from '@actions/io' ;
1314import colors from 'ansi-colors' ;
1415import yaml from 'js-yaml' ;
15- import * as glob from '@actions/glob' ;
16-
17- import buildRoutes from './routes.js' ;
1816import checkPackageName from './packageChecker.js' ;
17+ import buildRoutes from './routes.js' ;
1918
2019const uploadArtifacts = async ( diffpath ) => {
2120 if ( ! fs . existsSync ( diffpath ) ) {
@@ -59,9 +58,9 @@ const uploadTestData = async (options) => {
5958 return ;
6059 }
6160
62- const existPaths = artifacts . filter ( ( artifactPath ) => (
63- fs . existsSync ( path . join ( projectSourcePath , artifactPath ) )
64- ) ) ;
61+ const existPaths = artifacts . filter ( ( artifactPath ) =>
62+ fs . existsSync ( path . join ( projectSourcePath , artifactPath ) ) ,
63+ ) ;
6564
6665 if ( existPaths . length === 0 ) {
6766 return ;
@@ -75,7 +74,11 @@ const uploadTestData = async (options) => {
7574 const artifactName = 'test-data' ;
7675 const artifactClient = new DefaultArtifactClient ( ) ;
7776 const archivePath = path . join ( projectSourcePath , archiveName ) ;
78- await artifactClient . uploadArtifact ( artifactName , [ archivePath ] , projectSourcePath ) ;
77+ await artifactClient . uploadArtifact (
78+ artifactName ,
79+ [ archivePath ] ,
80+ projectSourcePath ,
81+ ) ;
7982 core . info ( colors . bgYellow . black ( 'Download snapshots from Artifacts.' ) ) ;
8083} ;
8184
@@ -101,7 +104,10 @@ const prepareProject = async (options) => {
101104 await exec . exec ( copyCmd , null , cmdOptions ) ;
102105 await io . mkdirP ( codePath ) ;
103106 await io . cp ( `${ projectPath } /.` , codePath , { recursive : true } ) ;
104- await exec . exec ( 'docker' , [ 'build' , '--cache-from' , projectImageName , '.' ] , { ...cmdOptions , cwd : projectSourcePath } ) ;
107+ await exec . exec ( 'docker' , [ 'build' , '--cache-from' , projectImageName , '.' ] , {
108+ ...cmdOptions ,
109+ cwd : projectSourcePath ,
110+ } ) ;
105111} ;
106112
107113const check = async ( { projectSourcePath, codePath, projectMember } ) => {
@@ -110,7 +116,11 @@ const check = async ({ projectSourcePath, codePath, projectMember }) => {
110116 const options = { cwd : projectSourcePath } ;
111117 // NOTE: Installing dependencies is part of testing the project.
112118 await exec . exec ( 'docker compose' , [ 'run' , 'app' , 'make' , 'setup' ] , options ) ;
113- await exec . exec ( 'docker compose' , [ '-f' , 'docker-compose.yml' , 'up' , '--abort-on-container-exit' ] , options ) ;
119+ await exec . exec (
120+ 'docker compose' ,
121+ [ '-f' , 'docker-compose.yml' , 'up' , '--abort-on-container-exit' ] ,
122+ options ,
123+ ) ;
114124
115125 const checkState = {
116126 state : 'success' ,
@@ -166,12 +176,7 @@ export const runPostActions = async (params) => {
166176 const { mountPath, projectMemberId, verbose } = params ;
167177 const projectSourcePath = path . join ( mountPath , 'source' ) ;
168178
169- const diffpath = path . join (
170- mountPath ,
171- 'source' ,
172- 'tmp' ,
173- 'artifacts' ,
174- ) ;
179+ const diffpath = path . join ( mountPath , 'source' , 'tmp' , 'artifacts' ) ;
175180
176181 const options = {
177182 projectSourcePath,
0 commit comments