1
Fork 0
mirror of https://gitea.com/actions/upload-artifact.git synced 2024-11-09 18:25:58 +01:00
This commit is contained in:
Josh Gross 2024-08-15 16:31:57 -04:00
parent cb6558bb10
commit acb59e4776
No known key found for this signature in database
7 changed files with 13 additions and 7 deletions

View file

@ -6,5 +6,5 @@ export enum Inputs {
RetentionDays = 'retention-days', RetentionDays = 'retention-days',
CompressionLevel = 'compression-level', CompressionLevel = 'compression-level',
DeleteMerged = 'delete-merged', DeleteMerged = 'delete-merged',
IncludeHiddenFiles = 'include-hidden-files', IncludeHiddenFiles = 'include-hidden-files'
} }

View file

@ -19,7 +19,7 @@ export function getInputs(): MergeInputs {
deleteMerged, deleteMerged,
retentionDays: 0, retentionDays: 0,
compressionLevel: 6, compressionLevel: 6,
includeHiddenFiles, includeHiddenFiles
} as MergeInputs } as MergeInputs
const retentionDaysStr = core.getInput(Inputs.RetentionDays) const retentionDaysStr = core.getInput(Inputs.RetentionDays)

View file

@ -62,7 +62,10 @@ export async function run(): Promise<void> {
options.compressionLevel = inputs.compressionLevel options.compressionLevel = inputs.compressionLevel
} }
const searchResult = await findFilesToUpload(tmpDir, inputs.includeHiddenFiles) const searchResult = await findFilesToUpload(
tmpDir,
inputs.includeHiddenFiles
)
await uploadArtifact( await uploadArtifact(
inputs.name, inputs.name,

View file

@ -81,7 +81,7 @@ function getMultiPathLCA(searchPaths: string[]): string {
export async function findFilesToUpload( export async function findFilesToUpload(
searchPath: string, searchPath: string,
includeHiddenFiles?: boolean, includeHiddenFiles?: boolean
): Promise<SearchResult> { ): Promise<SearchResult> {
const searchResults: string[] = [] const searchResults: string[] = []
const globber = await glob.create( const globber = await glob.create(

View file

@ -6,7 +6,7 @@ export enum Inputs {
RetentionDays = 'retention-days', RetentionDays = 'retention-days',
CompressionLevel = 'compression-level', CompressionLevel = 'compression-level',
Overwrite = 'overwrite', Overwrite = 'overwrite',
IncludeHiddenFiles = 'include-hidden-files', IncludeHiddenFiles = 'include-hidden-files'
} }
export enum NoFileOptions { export enum NoFileOptions {

View file

@ -29,7 +29,7 @@ export function getInputs(): UploadInputs {
searchPath: path, searchPath: path,
ifNoFilesFound: noFileBehavior, ifNoFilesFound: noFileBehavior,
overwrite: overwrite, overwrite: overwrite,
includeHiddenFiles: includeHiddenFiles, includeHiddenFiles: includeHiddenFiles
} as UploadInputs } as UploadInputs
const retentionDaysStr = core.getInput(Inputs.RetentionDays) const retentionDaysStr = core.getInput(Inputs.RetentionDays)

View file

@ -24,7 +24,10 @@ async function deleteArtifactIfExists(artifactName: string): Promise<void> {
export async function run(): Promise<void> { export async function run(): Promise<void> {
const inputs = getInputs() const inputs = getInputs()
const searchResult = await findFilesToUpload(inputs.searchPath, inputs.includeHiddenFiles) const searchResult = await findFilesToUpload(
inputs.searchPath,
inputs.includeHiddenFiles
)
if (searchResult.filesToUpload.length === 0) { if (searchResult.filesToUpload.length === 0) {
// No files were found, different use cases warrant different types of behavior if nothing is found // No files were found, different use cases warrant different types of behavior if nothing is found
switch (inputs.ifNoFilesFound) { switch (inputs.ifNoFilesFound) {