Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet committed Dec 21, 2023
1 parent abbf066 commit 7fefaca
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 6 deletions.
23 changes: 20 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

22 changes: 21 additions & 1 deletion src/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {GitHub} from '@actions/github/lib/utils'
import {InputsArtifacts} from './inputs-helper'
import fs from 'fs'
import https from 'https'
import { dir } from 'console'

Check failure on line 17 in src/artifacts.ts

View workflow job for this annotation

GitHub Actions / build

'dir' is defined but never used

export async function workflowName(
workflow?: string | undefined
Expand Down Expand Up @@ -48,7 +49,7 @@ export async function setOutputs(name: string, url: string): Promise<void> {
core.setOutput('link', `${url}/builds/${name}`)
}

export async function setNotice(name: string, url: string): Promise<void> {
export async function setNotice(name: string, url: string, requests?: string[]): Promise<void> {
if (core.summary.isEmptyBuffer() === true) {
await core.summary.addHeading('Artifacts').write()
}
Expand All @@ -57,6 +58,25 @@ export async function setNotice(name: string, url: string): Promise<void> {
.addRaw('Artifacts has been uploaded to the following location:')
.addLink(`${name}`, `${url}/builds/${name}`)
.write()
// if requests is defined, we add a list with the directories
// that have been created within requests.
// first we retrieve the directories
if (requests !== undefined) {

let directories: string[] = []

for (const file of requests) {
const dirname = path.dirname(file)

Check failure on line 69 in src/artifacts.ts

View workflow job for this annotation

GitHub Actions / build

'directories' is never reassigned. Use 'const' instead
if (directories.includes(dirname) === false) {
directories.push(`[dirname](${url}/builds/${name}/${dirname})})`)
}
}
// then we add the list
await core.summary
.addHeading('Directories', 3)
.addList(directories)
.write()
}
}

export async function fileUpload(
Expand Down
2 changes: 1 addition & 1 deletion src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export async function upload(inputs: InputsArtifacts): Promise<void> {
core.info('All files are uploaded ')

await setOutputs(name, inputs.url)
await setNotice(name, inputs.url)
await setNotice(name, inputs.url, requests)
}

export async function get(inputs: InputsArtifacts): Promise<void> {
Expand Down

0 comments on commit 7fefaca

Please sign in to comment.