@@ -118,7 +118,16 @@ export async function runAction (options: Options) {
118118 //store output files as artifacts
119119 core . info ( 'Store json Results as Artifact' )
120120 const { DefaultArtifactClient } = require ( '@actions/artifact' ) ;
121- const artifactClient = new DefaultArtifactClient ( ) ;
121+ const artifactV1 = require ( '@actions/artifact-v1' ) ;
122+ let artifactClient ;
123+
124+ if ( options ?. platformType === 'ENTERPRISE' ) {
125+ artifactClient = artifactV1 . create ( ) ;
126+ core . info ( `Initialized the artifact object using version V1.` ) ;
127+ } else {
128+ artifactClient = new DefaultArtifactClient ( ) ;
129+ core . info ( `Initialized the artifact object using version V2.` ) ;
130+ }
122131 const artifactName = 'Veracode Agent Based SCA Results' ;
123132 const files = [
124133 'scaResults.json'
@@ -188,7 +197,16 @@ export async function runAction (options: Options) {
188197 //store output files as artifacts
189198 core . info ( 'Store txt Results as Artifact' )
190199 const { DefaultArtifactClient } = require ( '@actions/artifact' ) ;
191- const artifactClient = new DefaultArtifactClient ( ) ;
200+ const artifactV1 = require ( '@actions/artifact-v1' ) ;
201+ let artifactClient ;
202+
203+ if ( options ?. platformType === 'ENTERPRISE' ) {
204+ artifactClient = artifactV1 . create ( ) ;
205+ core . info ( `Initialized the artifact object using version V1.` ) ;
206+ } else {
207+ artifactClient = new DefaultArtifactClient ( ) ;
208+ core . info ( `Initialized the artifact object using version V2.` ) ;
209+ }
192210 const artifactName = 'Veracode Agent Based SCA Results' ;
193211 const files = [
194212 'scaResults.txt'
0 commit comments