mirror of
https://github.com/actions/toolkit.git
synced 2026-08-22 00:00:21 +02:00
Fix linters
This commit is contained in:
@@ -391,7 +391,6 @@ describe('upload-artifact', () => {
|
|||||||
.mockRestore()
|
.mockRestore()
|
||||||
|
|
||||||
const singleFile = path.join(fixtures.uploadDirectory, 'file1.txt')
|
const singleFile = path.join(fixtures.uploadDirectory, 'file1.txt')
|
||||||
const expectedFileName = 'file1.txt'
|
|
||||||
const expectedContent = 'test 1 file content'
|
const expectedContent = 'test 1 file content'
|
||||||
|
|
||||||
jest
|
jest
|
||||||
|
|||||||
@@ -35,7 +35,9 @@ export async function createRawFileUploadStream(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a read stream from the file and pipe it to the upload stream
|
// Create a read stream from the file and pipe it to the upload stream
|
||||||
const fileStream = fs.createReadStream(sourcePath, {highWaterMark: bufferSize})
|
const fileStream = fs.createReadStream(sourcePath, {
|
||||||
|
highWaterMark: bufferSize
|
||||||
|
})
|
||||||
|
|
||||||
fileStream.on('error', error => {
|
fileStream.on('error', error => {
|
||||||
core.error('An error has occurred while reading the file for upload')
|
core.error('An error has occurred while reading the file for upload')
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export async function uploadArtifact(
|
|||||||
): Promise<UploadArtifactResponse> {
|
): Promise<UploadArtifactResponse> {
|
||||||
let artifactFileName = `${name}.zip`
|
let artifactFileName = `${name}.zip`
|
||||||
if (options?.skipArchive) {
|
if (options?.skipArchive) {
|
||||||
if (files.length > 1){
|
if (files.length > 1) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'skipArchive option is only supported when uploading a single file'
|
'skipArchive option is only supported when uploading a single file'
|
||||||
)
|
)
|
||||||
@@ -86,7 +86,7 @@ export async function uploadArtifact(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
let stream : WaterMarkedUploadStream
|
let stream: WaterMarkedUploadStream
|
||||||
|
|
||||||
if (options?.skipArchive) {
|
if (options?.skipArchive) {
|
||||||
// Upload raw file without archiving
|
// Upload raw file without archiving
|
||||||
@@ -101,10 +101,10 @@ export async function uploadArtifact(
|
|||||||
|
|
||||||
core.info(`Uploading artifact: ${artifactFileName}`)
|
core.info(`Uploading artifact: ${artifactFileName}`)
|
||||||
const uploadResult = await uploadToBlobStorage(
|
const uploadResult = await uploadToBlobStorage(
|
||||||
createArtifactResp.signedUploadUrl,
|
createArtifactResp.signedUploadUrl,
|
||||||
stream,
|
stream,
|
||||||
contentType
|
contentType
|
||||||
)
|
)
|
||||||
|
|
||||||
// finalize the artifact
|
// finalize the artifact
|
||||||
const finalizeArtifactReq: FinalizeArtifactRequest = {
|
const finalizeArtifactReq: FinalizeArtifactRequest = {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import * as stream from 'stream'
|
|
||||||
import {realpath} from 'fs/promises'
|
import {realpath} from 'fs/promises'
|
||||||
import archiver from 'archiver'
|
import archiver from 'archiver'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
|
|||||||
Reference in New Issue
Block a user