Pull (get it?) artifacts from GitHub action workflow for local testing
Originally part of the testing tool for celer, extracted for general use.
cargo install magnesis --git https://github.com/Pistonite/magnesis
You first need a GitHub personal access token (PAT) with repo read permissions. See here
This token is read from the environment variable GITHUB_TOKEN
.
Download artifacts from a workflow ran on the current commit, in the current repository,
and extract them to dist
:
magnesis
See magnesis --help
for more options.
You can change the output directory with -o
:
magnesis -o output
By default, calls git remote get-url origin
to get the repository URL, and parses it to get the owner and repository name
if it's in the form http(s)://github.com/OWNER/REPO(.git)
or [email protected]:OWNER/REPO(.git)
.
magnesis --repo foo/bar
If origin
is not the remote to use or the URL is not in the expected format, you can specify the repository with the --repo
flag
(for example, when there are multiple remotes).
By default, calls git rev-parse HEAD
to get the current commit. To use another commit, you can specify it with the --rev
flag.
magnesis --rev foo
This will call git rev-parse foo
to get the commit hash.
However, if foo
already looks like a full commit hash, it will be used as-is.
This is useful when downloading artifacts from another repo.