Test downloading artifacts #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test downloading artifacts" | |
on: | |
workflow_dispatch: | |
jobs: | |
generate-artifacts: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
cd "$GITHUB_WORKSPACE" | |
mkdir ./expired-d | |
touch ./expired-d/test-1.txt | |
touch ./expired-d/test-2.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: E_TEST_01 | |
path: | | |
expired-d/test-1.txt | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: E_TEST_02 | |
path: | | |
expired-d/test-2.txt | |
download-artifacts: | |
needs: generate-artifacts | |
runs-on: ubuntu-latest | |
container: ghcr.io/filtersheroes/expired_domains_image:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npm install @actions/artifact | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
const artifact = require("@actions/artifact") | |
const artifactClient = artifact.create() | |
const artifactFiles = ["E_TEST_01", "E_TEST_02"] | |
for (artifactFile of artifactFiles) { | |
await artifactClient.downloadArtifact(artifactFile, { createArtifactFolder: false }) | |
} | |
- run: | | |
ls -l ./expired-d |