Skip to content

Commit

Permalink
Support artifact-url output (#496)
Browse files Browse the repository at this point in the history
* Support artifact-url output

* update dist/index.js

* Update license

* Simplify output

* Update README
  • Loading branch information
konradpabjan authored Jan 10, 2024
1 parent c320f57 commit 73d8b66
Show file tree
Hide file tree
Showing 7 changed files with 4,149 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .licenses/npm/@actions/github.dep.yml

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

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ For assistance with breaking changes, see [MIGRATION.md](docs/MIGRATION.md).
| Name | Description | Example |
| - | - | - |
| `artifact-id` | GitHub ID of an Artifact, can be used by the REST API | `1234` |
| `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` |

## Examples

Expand Down
11 changes: 10 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,18 @@ inputs:
outputs:
artifact-id:
description: >
A unique identifier for the artifact that was just uploaded. Empty if artifact upload failed.
A unique identifier for the artifact that was just uploaded. Empty if the artifact upload failed.
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
artifact-url:
description: >
A download URL for the artifact that was just uploaded. Empty if the artifact upload failed.
This download URL only works for requests Authenticated with GitHub. Anonymous downloads will be prompted to first login.
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
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.
Common uses cases for such a download URL can be adding download links to artifacts in descriptions or comments on pull requests or issues.
runs:
using: 'node20'
main: 'dist/index.js'
Loading

0 comments on commit 73d8b66

Please sign in to comment.