1
0
Fork 0
pull/1503/head
Bethany 2023-08-22 10:06:40 -07:00
parent 4214a1ff24
commit 81a802e7e0
7 changed files with 13 additions and 13 deletions

View File

@ -1,6 +1,5 @@
import path from 'path'
import fs from 'fs/promises'
import {PathLike} from 'fs'
import * as github from '@actions/github'
import * as core from '@actions/core'
import * as httpClient from '@actions/http-client'

View File

@ -1,4 +1,4 @@
import {Artifact, GetArtifactResponse} from '../shared/interfaces'
import {GetArtifactResponse} from '../shared/interfaces'
import {getOctokit} from '@actions/github'
import {getUserAgentString} from '../shared/user-agent'
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'

View File

@ -72,14 +72,14 @@ export async function listArtifacts(
}
// Iterate over the first page
listArtifactResponse.artifacts.forEach(artifact => {
for (const artifact of listArtifactResponse.artifacts) {
artifacts.push({
name: artifact.name,
id: artifact.id,
url: artifact.url,
size: artifact.size_in_bytes
})
})
}
// Iterate over any remaining pages
for (
@ -99,19 +99,19 @@ export async function listArtifacts(
page: currentPageNumber
})
listArtifactResponse.artifacts.forEach(artifact => {
for (const artifact of listArtifactResponse.artifacts) {
artifacts.push({
name: artifact.name,
id: artifact.id,
url: artifact.url,
size: artifact.size_in_bytes
})
})
}
}
info(`Finished fetching artifact list`)
return {
artifacts: artifacts
artifacts
}
}

View File

@ -1,4 +1,4 @@
var packageJson = require('../../../package.json')
import * as packageJson from '../../../package.json'
/**
* Ensure that this User Agent String is used in all HTTP calls so that we can monitor telemetry between different versions of this package

View File

@ -91,6 +91,6 @@ export async function uploadZipToBlobStorage(
return {
isSuccess: true,
uploadSize: uploadByteCount,
md5Hash: md5Hash
md5Hash
}
}

View File

@ -61,7 +61,7 @@ export async function uploadArtifact(
const createArtifactReq: CreateArtifactRequest = {
workflowRunBackendId: backendIds.workflowRunBackendId,
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
name: name,
name,
version: 4
}
@ -96,13 +96,13 @@ export async function uploadArtifact(
const finalizeArtifactReq: FinalizeArtifactRequest = {
workflowRunBackendId: backendIds.workflowRunBackendId,
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
name: name,
name,
size: uploadResult.uploadSize!.toString()
}
if (uploadResult.md5Hash) {
finalizeArtifactReq.hash = StringValue.create({
value: `md5:${uploadResult.md5Hash!}`
value: `md5:${uploadResult.md5Hash}`
})
}

View File

@ -16,5 +16,6 @@
},
"include": [
"./src"
]
],
"resolveJsonModule": true
}