mirror of https://github.com/actions/toolkit
lint
parent
4214a1ff24
commit
81a802e7e0
|
@ -1,6 +1,5 @@
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import fs from 'fs/promises'
|
import fs from 'fs/promises'
|
||||||
import {PathLike} from 'fs'
|
|
||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as httpClient from '@actions/http-client'
|
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 {getOctokit} from '@actions/github'
|
||||||
import {getUserAgentString} from '../shared/user-agent'
|
import {getUserAgentString} from '../shared/user-agent'
|
||||||
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
|
import {defaults as defaultGitHubOptions} from '@actions/github/lib/utils'
|
||||||
|
|
|
@ -72,14 +72,14 @@ export async function listArtifacts(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate over the first page
|
// Iterate over the first page
|
||||||
listArtifactResponse.artifacts.forEach(artifact => {
|
for (const artifact of listArtifactResponse.artifacts) {
|
||||||
artifacts.push({
|
artifacts.push({
|
||||||
name: artifact.name,
|
name: artifact.name,
|
||||||
id: artifact.id,
|
id: artifact.id,
|
||||||
url: artifact.url,
|
url: artifact.url,
|
||||||
size: artifact.size_in_bytes
|
size: artifact.size_in_bytes
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
|
||||||
// Iterate over any remaining pages
|
// Iterate over any remaining pages
|
||||||
for (
|
for (
|
||||||
|
@ -99,19 +99,19 @@ export async function listArtifacts(
|
||||||
page: currentPageNumber
|
page: currentPageNumber
|
||||||
})
|
})
|
||||||
|
|
||||||
listArtifactResponse.artifacts.forEach(artifact => {
|
for (const artifact of listArtifactResponse.artifacts) {
|
||||||
artifacts.push({
|
artifacts.push({
|
||||||
name: artifact.name,
|
name: artifact.name,
|
||||||
id: artifact.id,
|
id: artifact.id,
|
||||||
url: artifact.url,
|
url: artifact.url,
|
||||||
size: artifact.size_in_bytes
|
size: artifact.size_in_bytes
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info(`Finished fetching artifact list`)
|
info(`Finished fetching artifact list`)
|
||||||
|
|
||||||
return {
|
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
|
* 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 {
|
return {
|
||||||
isSuccess: true,
|
isSuccess: true,
|
||||||
uploadSize: uploadByteCount,
|
uploadSize: uploadByteCount,
|
||||||
md5Hash: md5Hash
|
md5Hash
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ export async function uploadArtifact(
|
||||||
const createArtifactReq: CreateArtifactRequest = {
|
const createArtifactReq: CreateArtifactRequest = {
|
||||||
workflowRunBackendId: backendIds.workflowRunBackendId,
|
workflowRunBackendId: backendIds.workflowRunBackendId,
|
||||||
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
||||||
name: name,
|
name,
|
||||||
version: 4
|
version: 4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,13 +96,13 @@ export async function uploadArtifact(
|
||||||
const finalizeArtifactReq: FinalizeArtifactRequest = {
|
const finalizeArtifactReq: FinalizeArtifactRequest = {
|
||||||
workflowRunBackendId: backendIds.workflowRunBackendId,
|
workflowRunBackendId: backendIds.workflowRunBackendId,
|
||||||
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
||||||
name: name,
|
name,
|
||||||
size: uploadResult.uploadSize!.toString()
|
size: uploadResult.uploadSize!.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uploadResult.md5Hash) {
|
if (uploadResult.md5Hash) {
|
||||||
finalizeArtifactReq.hash = StringValue.create({
|
finalizeArtifactReq.hash = StringValue.create({
|
||||||
value: `md5:${uploadResult.md5Hash!}`
|
value: `md5:${uploadResult.md5Hash}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,5 +16,6 @@
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./src"
|
"./src"
|
||||||
]
|
],
|
||||||
|
"resolveJsonModule": true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue