mirror of
https://code.forgejo.org/forgejo/upload-artifact.git
synced 2025-05-17 04:37:48 +02:00
Support artifact-url output (#496)
* Support artifact-url output * update dist/index.js * Update license * Simplify output * Update README
This commit is contained in:
parent
c320f57948
commit
73d8b66ede
7 changed files with 4149 additions and 36 deletions
|
@ -1,4 +1,5 @@
|
|||
import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
import artifact, {UploadArtifactOptions} from '@actions/artifact'
|
||||
import {findFilesToUpload} from './search'
|
||||
import {getInputs} from './input-helper'
|
||||
|
@ -57,6 +58,12 @@ async function run(): Promise<void> {
|
|||
`Artifact ${inputs.artifactName} has been successfully uploaded! Final size is ${uploadResponse.size} bytes. Artifact ID is ${uploadResponse.id}`
|
||||
)
|
||||
core.setOutput('artifact-id', uploadResponse.id)
|
||||
|
||||
const repository = github.context.repo
|
||||
const artifactURL = `${github.context.serverUrl}/${repository.owner}/${repository.repo}/actions/runs/${github.context.runId}/artifacts/${uploadResponse.id}`
|
||||
|
||||
core.info(`Artifact download URL: ${artifactURL}`)
|
||||
core.setOutput('artifact-url', artifactURL)
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed((error as Error).message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue