I use GitHub-action for my build, and it generates multiple artifacts (with a different name).
Is there a way to predict the URL of the artifacts of the last successful build? Without knowing the sha1, only the name of the artifact and the repo?
By default, the download-artifact action downloads artifacts to the workspace directory that the step is executing in. You can use the path input parameter to specify a different download directory.
We recommend using Artifact Registry for storing build artifacts. Artifact Registry is a Google Cloud product that you can integrate with Cloud Build to securely store and manage your artifacts in private or public repositories.
link for GitHub. This service lets you get a shareable link to download a build artifact from the latest successful GitHub Actions build of a repository. Any public repository is accessible by default and visitors don't need to log in.
At the moment, no, according to comments from staff although this may change with future versions of the upload-artifact
action.
After poking around myself, it is possible to get this using the GitHub actions API: https://developer.github.com/v3/actions/artifacts/
GET /repos/:owner/:repo/actions/runs/:run_id/artifacts
So you can receive a JSON reply and iterate through the "artifacts" array to get the corresponding "archive_download_url". A workflow can fill in the URL like so:
/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts
I have developed a service that exposes predictable URLs to either the latest or a particular artifact of a repository's branch+workflow.
https://nightly.link/
https://github.com/oprypin/nightly.link
This is implemented as a GitHub App, and communication with GitHub is authenticated, but users that only download don't need to even log in to GitHub.
The implementation goes and fetches this through the API, in 3 steps:
https://api.github.com/repos/:owner/:repo/actions/workflows/someworkflow.yml/runs?per_page=1&branch=master&event=push&status=success
https://api.github.com/repos/:owner/:repo/actions/runs/123456789/artifacts?per_page=100
https://api.github.com/repos/:owner/:repo/actions/artifacts/87654321/zip
(the last one redirects you to an ephemeral direct download URL)
Note that authentication is required. For OAuth that's public_repo
(or repo
if appropriate). For GitHub Apps that's "Actions"/"Read-only".
There is indeed no more direct way to do this.
Some relevant issues are
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With