-
Notifications
You must be signed in to change notification settings - Fork 575
feat: implement new artifact-ids
input
#401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new input, artifact-ids, which allows users to download artifacts by their unique IDs rather than by name to leverage artifact immutability for enhanced security.
- Adds the artifact-ids input and associated validation logic in the download artifact code
- Updates documentation, tests, and constants to support this new input
- Modifies error messages and info logs to reflect the mutually exclusive usage of name and artifact-ids
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/download-artifact.ts | Added artifact-ids input with validation and branch handling for downloading by IDs |
src/constants.ts | Updated enumeration to include artifact-ids |
docs/MIGRATION.md | Documented new immutable artifacts workflow |
action.yml | Introduced new input definition for artifact-ids |
tests/download.test.ts | Updated test expectation messages to include artifact-ids |
README.md | Enhanced documentation with examples for downloading artifacts by ID |
Comments suppressed due to low confidence (1)
src/download-artifact.ts:89
- Ensure dedicated tests are added for the new artifact-ids branch, including scenarios for non-numeric input and cases where provided IDs are missing, to increase test coverage.
else if (isDownloadByIds) {
…esulting id returned
…`isSingleArtifactDownload` logic
…y artifact-ids until a `getArtifactById()` public method exists
I'm not quite sure what the release process looks like for this project so I'll just merge and leave it at that. Thanks! 🙇 |
upload: | ||
runs-on: ubuntu-latest | ||
steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example needs a small correction to add an outputs:
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixing in #402
artifact-ids
inputThis pull request implements a new
artifact-ids
input which takes a comma separated list of artifact ids for this Action to download.Why?
In
v4
, artifacts are immutable by default and each artifact gets a unique ID when uploaded. When an artifact with the same name is uploaded again (with or withoutoverwrite: true
), it gets a new artifact ID.To take advantage of this immutability for security purposes (to avoid potential TOCTOU issues where an artifact might be replaced between upload and download), the new
artifact-ids
input allows you to download artifacts by their specific ID rather than by name:This approach provides stronger guarantees about which artifact version you're downloading compared to using just the artifact name.
Testing
I gave this a go in another project and it works great!
resolves: #349