Repository navigation
how to use artifact between workflows? #2022
Replies: 1 comment
|
1. The REST API (no extra action needed). Artifacts from any run in the repo are listed and downloadable with the run token, as long as the job has permissions:
actions: read
contents: read
steps:
- name: Download artifact from another workflow
env:
GH_ENTERPRISE_TOKEN: ${{ github.token }} # on GHES gh reads this one, not GH_TOKEN
GH_HOST: your-ghes-host
NAME: my-unique-artifact
run: |
id=$(gh api "repos/${{ github.repository }}/actions/artifacts?name=$NAME&per_page=1" --jq ".artifacts[0].id")
gh api "repos/${{ github.repository }}/actions/artifacts/$id/zip" > artifact.zip
unzip -o artifact.zip -d artifactThe list is newest first, so 2. A community action such as Things that trip people up: the artifact must not have expired (retention), and on GHES the token needs |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
we are on GHES and the only version supported is https://www.npmjs.com/package/@actions/artifact/v/1.1.2
in this version it doesn't seem to accept findBy
is there anyway to download artifact from another workflow (I have unique names for the artifacts)
All reactions