@@ -1424,16 +1424,18 @@ If you know what you're doing and would like to suppress this warning, use one o
14241424 let time , endTime ;
14251425 let cpCmd = "shopt -s globstar nullglob dotglob\n" ;
14261426 cpCmd += `mkdir -p ${ artifactsPath } /${ safeJobName } \n` ;
1427- cpCmd += "rsync --exclude '.gitlab-ci-local/**' -Ra " ;
1427+ cpCmd += "_gcl_files_tmp=\\$(mktemp)\n" ;
1428+ for ( const artifactPath of this . artifacts ?. paths ?? [ ] ) {
1429+ const expandedPath = Utils . expandText ( artifactPath , expanded ) . replace ( `${ expanded . CI_PROJECT_DIR } /` , "" ) ;
1430+ cpCmd += `for _gcl_f in ./${ expandedPath } ; do printf '%s\\n' "\\$_gcl_f"; done >> \\$_gcl_files_tmp\n` ;
1431+ }
1432+ cpCmd += "rsync --exclude '.gitlab-ci-local/**' -rRa " ;
14281433 for ( const artifactExcludePath of this . artifacts ?. exclude ?? [ ] ) {
14291434 const expandedPath = Utils . expandText ( artifactExcludePath , expanded ) . replace ( `${ expanded . CI_PROJECT_DIR } /` , "" ) ;
14301435 cpCmd += `--exclude '${ expandedPath } ' ` ;
14311436 }
1432- for ( const artifactPath of this . artifacts ?. paths ?? [ ] ) {
1433- const expandedPath = Utils . expandText ( artifactPath , expanded ) . replace ( `${ expanded . CI_PROJECT_DIR } /` , "" ) ;
1434- cpCmd += `./${ expandedPath } ` ;
1435- }
1436- cpCmd += `${ artifactsPath } /${ safeJobName } /. || true\n` ;
1437+ cpCmd += `--files-from=\\$_gcl_files_tmp . ${ artifactsPath } /${ safeJobName } /. || true\n` ;
1438+ cpCmd += "rm -f \\$_gcl_files_tmp\n" ;
14371439 const reportDotenv = Utils . expandText ( this . artifacts . reports ?. dotenv ?? null , expanded ) ;
14381440 const reportDotenvs : string [ ] | null = ( typeof reportDotenv === "string" ) ? // normalize to string[] for easier handling
14391441 [ reportDotenv ] :
0 commit comments