@@ -3,24 +3,29 @@ import { endGroup, getInput, startGroup } from '@actions/core'
33import { context , getOctokit } from '@actions/github'
44import { retry } from '@octokit/plugin-retry'
55import { Md5 } from 'ts-md5'
6- import { DefaultArtifactClient , UploadArtifactResponse } from '@actions/artifact'
6+ import {
7+ Artifact ,
8+ DefaultArtifactClient ,
9+ GetArtifactResponse ,
10+ UploadArtifactResponse ,
11+ } from '@actions/artifact'
712
813const artifact = new DefaultArtifactClient ( )
914
10- export function uploadArtifact (
11- artifactName : string ,
12- ...files : string [ ]
13- ) : Promise < UploadArtifactResponse > {
15+ export async function uploadArtifact ( artifactName : string , ...files : string [ ] ) {
1416 startGroup ( 'Uploading artifact ' + artifactName )
15- var reponse = artifact . uploadArtifact ( artifactName , files , '.' )
17+ await artifact . uploadArtifact ( artifactName , files , '.' )
1618 endGroup ( )
17- return reponse
1819}
1920
20- export async function downloadArtifact ( artifactName : string ) {
21+ export async function downloadArtifact ( artifactName : string ) : Promise < Artifact > {
2122 startGroup ( 'Downloading artifact ' + artifactName )
22- await create . getArtifact ( artifactName )
23+ var reponse = await artifact . getArtifact ( artifactName )
24+ if ( reponse === undefined ) {
25+ throw new Error ( 'Artifact not found' )
26+ }
2327 endGroup ( )
28+ return reponse . artifact
2429}
2530
2631export async function postCommentIfInPr ( message : string ) : Promise < string | undefined > {
0 commit comments