@@ -8,14 +8,15 @@ const whichChrome = require('./which-chrome');
88async function run ( ) {
99 try {
1010 // Get inputs: source, destination, and anything else
11- const { source, destination : destFile , ...inputs } = loadInputs ( ) ;
11+ const { source, destination : destFile , makeartifact , ...inputs } = loadInputs ( ) ;
1212 core . debug ( `source is ${ source } ` ) ;
1313 core . debug ( `destination is ${ destFile } ` ) ;
1414 core . debug ( `other inputs are ${ JSON . stringify ( inputs , null , 4 ) } ` ) ;
1515
1616 // Get destination
1717 const destFolder = process . env . RUNNER_TEMP ;
1818 const dest = path . join ( destFolder , destFile ) ;
19+ const makeArtifact = makeartifact == "true" ;
1920
2021 // Locate Google Chrome executable
2122 const executablePath = await whichChrome ( ) ;
@@ -32,10 +33,13 @@ async function run() {
3233 // Capture and write to dest
3334 await captureWebsite . file ( source , dest , options ) ;
3435
35- // Create an artifact
36- const artifactClient = artifact . create ( ) ;
37- const artifactName = destFile . substr ( 0 , destFile . lastIndexOf ( '.' ) ) ;
38- await artifactClient . uploadArtifact ( artifactName , [ dest ] , destFolder ) ;
36+ if ( makeArtifact )
37+ {
38+ // Create an artifact
39+ const artifactClient = artifact . create ( ) ;
40+ const artifactName = destFile . substr ( 0 , destFile . lastIndexOf ( '.' ) ) ;
41+ await artifactClient . uploadArtifact ( artifactName , [ dest ] , destFolder ) ;
42+ }
3943
4044 // Expose the path to the screenshot as an output
4145 core . setOutput ( 'path' , dest ) ;
@@ -44,4 +48,4 @@ async function run() {
4448 }
4549}
4650
47- module . exports = run ;
51+ module . exports = run ;
0 commit comments