Skip to content

Commit 73d8b66

Browse files
authored
Support artifact-url output (#496)
* Support artifact-url output * update dist/index.js * Update license * Simplify output * Update README
1 parent c320f57 commit 73d8b66

File tree

7 files changed

+4149
-36
lines changed

7 files changed

+4149
-36
lines changed

.licenses/npm/@actions/github.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ For assistance with breaking changes, see [MIGRATION.md](docs/MIGRATION.md).
9999
| Name | Description | Example |
100100
| - | - | - |
101101
| `artifact-id` | GitHub ID of an Artifact, can be used by the REST API | `1234` |
102+
| `artifact-url` | URL to download an Artifact. Can be used in many scenarios such as linking to artifacts in issues or pull requests. Users must be logged-in in order for this URL to work. This URL is valid as long as the artifact has not expired or the artifact, run or repository have not been deleted | `https://github.com/example-org/example-repo/actions/runs/1/artifacts/1234` |
102103

103104
## Examples
104105

action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,18 @@ inputs:
3838
outputs:
3939
artifact-id:
4040
description: >
41-
A unique identifier for the artifact that was just uploaded. Empty if artifact upload failed.
41+
A unique identifier for the artifact that was just uploaded. Empty if the artifact upload failed.
4242
4343
This ID can be used as input to other APIs to download, delete or get more information about an artifact: https://docs.github.com/en/rest/actions/artifacts
44+
artifact-url:
45+
description: >
46+
A download URL for the artifact that was just uploaded. Empty if the artifact upload failed.
47+
48+
This download URL only works for requests Authenticated with GitHub. Anonymous downloads will be prompted to first login.
49+
If an anonymous download URL is needed than a short time restricted URL can be generated using the download artifact API: https://docs.github.com/en/rest/actions/artifacts#download-an-artifact
50+
51+
This URL will be valid for as long as the artifact exists and the workflow run and repository exists. Once an artifact has expired this URL will no longer work.
52+
Common uses cases for such a download URL can be adding download links to artifacts in descriptions or comments on pull requests or issues.
4453
runs:
4554
using: 'node20'
4655
main: 'dist/index.js'

0 commit comments

Comments
 (0)