@@ -10,8 +10,8 @@ import * as core from '@actions/core';
1010import { VariableDetail , VariableStatus } from './types/variableStatus' ;
1111import { WORKDIR } from './config' ;
1212import rimraf from 'rimraf' ;
13- import { ArtifactClient , UploadOptions } from '@actions/artifact' ;
14- import { UploadResponse } from '@actions/ artifact/lib/internal/ upload-response ' ;
13+ import { ArtifactClient } from '@actions/artifact' ;
14+ import { UploadInputs } from './types/upload- artifact/upload-inputs ' ;
1515
1616// eslint-disable-next-line @typescript-eslint/no-var-requires
1717const artifact = require ( '@actions/artifact' ) ;
@@ -45,10 +45,11 @@ const defineVariableOperation = (variable: string): VariableStatus => {
4545
4646const storeArtifact = async ( variables : VariableDetail [ ] , failIfNotFound : boolean ) : Promise < void > => {
4747 const client : ArtifactClient = artifact . create ( ) ;
48- const artifactOptions : UploadOptions = {
48+ const artifactOptions : Partial < UploadInputs > = {
4949 retentionDays : 1 , // Only keep artifacts 1 day to avoid reach limit: https://github.com/actions/toolkit/blob/c861dd8859fe5294289fcada363ce9bc71e9d260/packages/artifact/src/internal/upload-options.ts#L1
5050 } ;
51- const artifactsUploadPromises : Promise < UploadResponse > [ ] = [ ] ;
51+ // Used to be able to use type "UploadResponse" but it's not exported by the lib in v2 anymore
52+ const artifactsUploadPromises : Promise < any > [ ] = [ ] ;
5253
5354 rimraf . sync ( WORKDIR ) ;
5455 mkdirSync ( WORKDIR ) ;
@@ -83,6 +84,7 @@ const retrieveArtifact = async (variables: VariableDetail[], failIfNotFound: boo
8384 for ( const variable of variables ) {
8485 try {
8586 const file = join ( WORKDIR , `${ variable . key } .txt` ) ;
87+ // @ts -ignore
8688 await client . downloadArtifact ( variable . key ) ;
8789 variable . value = readFileSync ( file , { encoding : 'utf8' } ) . toString ( ) ;
8890 core . exportVariable ( variable . key , variable . value ) ;
0 commit comments