Interview Prep/GitHub Actions/Caching, Artifacts, Builds & Scans

`Error: Unable to download artifact(s): Artifact not found for name: build`

BeginnerTroubleshootingCaching, Artifacts, Builds & Scans
Answer

Likely causes → Download job does not needs the upload job (runs in parallel), the name differs, the artifact is from another run (needs run-id and github-token), or it expired.

Diagnose →

gh run view <id> --json jobs
gh api repos/ORG/REPO/actions/runs/<id>/artifacts --jq '.artifacts[].name'

Fix → Add needs, align names, pass run-id and github-token: ${{ github.token }} with actions: read for cross-run.

Prevent → Use if-no-files-found: error on upload so missing artifacts fail early.

All GitHub Actions questions Roadmap: GitHub Actions

More on Caching, Artifacts, Builds & Scans