mirror of https://github.com/actions/toolkit
lint
parent
4214a1ff24
commit
81a802e7e0
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -91,6 +91,6 @@ export async function uploadZipToBlobStorage(
|
|||
return {
|
||||
isSuccess: true,
|
||||
uploadSize: uploadByteCount,
|
||||
md5Hash: md5Hash
|
||||
md5Hash
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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}`
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -16,5 +16,6 @@
|
|||
},
|
||||
"include": [
|
||||
"./src"
|
||||
]
|
||||
],
|
||||
"resolveJsonModule": true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue