bsteffaniak/Cache Artifact
Checksums a directory or git repository and conditionally runs commands with intelligent artifact caching
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Apr 29, 2026
- License
- None
Pinned Snippet
uses: bsteffaniak/cache-artifact@98aa4b9aa92cd3ef9e267baab324ef58c72637d0 # v1.0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| directory | Directory to checksum for change detection (mutually exclusive with repo) | no | "" |
| repo | Git repository URL to checksum for change detection (mutually exclusive with directory) | no | "" |
| command | Custom command to run when changes are detected | yes | — |
| output-path | Path to the output file/artifact created by the command | yes | — |
| artifact-name | Name for the artifact (defaults to directory name + checksum) | no | "" |
| cache-key-prefix | Prefix for cache keys (defaults to repository name) | no | "" |
| working-directory | Working directory to run the command in | no | . |
| shell | Shell to use for running commands | no | bash |
| make-executable | Whether to make the output file executable | no | false |
| verify-command | Command to run to verify the output works (e.g., "--version") | no | "" |
| github-token | GitHub token for downloading artifacts from other workflow runs (requires actions:read permission) | no | ${{ github.token }} |
| scope | Scope for artifact naming: 'run' (workflow run ID), 'workflow' (workflow name), 'job' (job ID), 'repo' (repository name), or 'none' (no suffix). Defaults to 'workflow' when github-token is not provided, 'none' when custom token is provided. | no | "" |
Outputs
| name | description |
|---|---|
| cache-hit | Whether the cache was hit (true/false) |
| checksum | The computed checksum of the directory |
| artifact-name | The name of the uploaded/downloaded artifact |