cloudposse / cloudposse/github-action-matrix-outputs-read
Limit number of artifacts downloaded
- Dominant language
- No language data
- Stars
- 13
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
## Describe the Feature
Currently, the system fetches all available artifacts from the storage, regardless of whether they are needed for the current task or not. This behavior can result in downloading unrelated or unnecessary files, leading to increased network usage, storage overhead, and potentially incorrect behavior if conflicting or invalid files are introduced.
This PR introduces support for limiting the artifacts fetched based on a specific pattern. As all artifacts are named after the SHA256 hash of their content, we can leverage pattern matching to ensure only valid and relevant artifacts are downloaded.
## Expected Behavior
Only artifacts whose filenames match a valid SHA256 hash pattern will be downloaded. This prevents the fetching of unrelated files and ensures a cleaner and more secure artifact management process.
## Use Case
When a large set of artifacts are stored in a shared location, it’s inefficient and potentially risky to download all of them indiscriminately. By downloading only artifacts with names that match the SHA256 format (a 64-character lowercase hexadecimal string), we can:
• Reduce bandwidth and storage usage.
• Avoid introducing unrelated or invalid artifacts.
• Improve security and reproducibility by ensuring artifact integrity.
## Describe Ideal Solution
Integrate a filtering mechanism into the artifact download logic that applies a pattern match to only fetch files named as valid SHA256 sums. This can be implemented using a regex check or prefix-based filtering, depending on the storage system’s capabilities.
## Alternatives Considered
• Continue downloading all files and filter them locally: Inefficient and still downloads potentially large volumes of unnecessary data.
Contributor guide
Assessment
This issue has not been assessed yet.