feat: add optional secret-name input to fetch a single secret - #39
Merged
Conversation
When `secret-name` is set, the action calls GET /api/v3/secrets/raw/{secretName}
instead of listing every secret in `secret-path`. The response is normalized into
the same key/value map, so all existing export paths are unchanged. `recursive` is
ignored (with a warning) in this mode, and a 404 fails the action with a clear message.
|
| Filename | Overview |
|---|---|
| src/infisical.ts | Adds the encoded v3 single-secret request, response normalization, and contextual 404 handling without establishing a concrete contract or security defect. |
| src/index.ts | Selects single- versus bulk-secret fetching from the optional input and warns when recursion is inapplicable. |
| action.yaml | Declares the optional secret-name action input consistently with its runtime handling. |
| README.md | Documents single-secret usage, export behavior, recursion semantics, and missing-secret failure behavior. |
| dist/index.cjs | Regenerates the executable action bundle with the source implementation. |
| dist/index.cjs.map | Regenerates the source map alongside the distributed bundle. |
Reviews (1): Last reviewed commit: "Add optional secret-name input to fetch ..." | Re-trigger Greptile
varonix0
approved these changes
Aug 25, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Daniel · Slack thread
Before
The action could only fetch every secret in a path. Getting one secret meant pulling the whole folder and picking it out of the exported env vars.
After
An optional
secret-nameinput fetches just that one secret.How
When
secret-nameis set,getRawSecret()callsGET /api/v3/secrets/raw/{secretName}and normalizes the response into the same key/value mapgetRawSecrets()returns, so every downstream export path (export-type,file-output-path, masking) is unchanged. When it is unset, behavior is identical to before.recursiveis meaningless for a single secret, so it emits acore.warningand is ignored. A 404 fails the step with the secret name, path and environment in the message instead of silently exporting nothing.dist/index.cjsis regenerated.Two notes for reviewers:
GET /api/v4/secrets/{secretName}; moving to v4 would be a separate change across the whole client.type(shared vs personal) andversion; these are not exposed as inputs, to keep the diff minimal.Testing
npx tsc --noEmitandnpm run buildare clean anddist/was regenerated. The repo has no test infrastructure, so this was verified against a mock Infisical server covering:secret-nameunset (unchanged list call),secret-nameset (single-secret call, value masked),secret-name+recursive(warning, single-secret call), and a 404 (exit 1 with a descriptive error).Generated by Claude Code