diff --git a/.github/workflows/artifact-download-demo.yml b/.github/workflows/artifact-download-demo.yml new file mode 100644 index 000000000..4a7d55097 --- /dev/null +++ b/.github/workflows/artifact-download-demo.yml @@ -0,0 +1,23 @@ +name: Download Artifact +run-name: ${{ github.actor }} is testing Artifact download! +on: + workflow_run: + workflows: ["Create Artifact"] + types: + - completed +jobs: + download_artifact: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Download Artifact + run: | + WF_NAME="artifact-test-demo.yml" + ARTIFACT_NAME="artifact-test" + RUN_ID=`gh run --repo ${{ github.repository }} list --workflow ${WF_NAME} --json databaseId --jq .[0].databaseId` + gh run --repo ${{ github.repository }} download ${RUN_ID} -n ${ARTIFACT_NAME} + # List the artifiact directory/files + ls -lR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}