feat: expose PROJECT_ID via environment variable#229
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb5cafb4c4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| INFISICAL_DEFAULT_EU_URL = "https://eu.infisical.com" | ||
| INFISICAL_WORKSPACE_CONFIG_FILE_NAME = ".infisical.json" | ||
| INFISICAL_TOKEN_NAME = "INFISICAL_TOKEN" | ||
| INFISICAL_PROJECT_ID_NAME = "INFISICAL_PROJECT_ID" |
There was a problem hiding this comment.
Avoid letting generic PROJECT_ID override config
Because this introduces the bare PROJECT_ID name, all call sites added in this commit now treat any existing cloud/CI PROJECT_ID as the Infisical project before the previous .infisical.json fallback runs; for example GetAllEnvironmentVariables only reads the workspace file when WorkspaceId is empty. In environments that already export PROJECT_ID for another system, commands such as run, secrets set/delete, or export will silently bypass the repo’s configured Infisical project and can fail or operate on the wrong project. Prefer only the Infisical-specific env var here, or consult the generic name after the workspace-file fallback.
Useful? React with 👍 / 👎.
|
Thanks @chatgpt-codex-connector! You are absolutely right. I've removed the generic |
|
To use Codex here, create a Codex account and connect to github. |
Fixes #213
This PR allows users to pass the project ID via the
INFISICAL_PROJECT_IDorPROJECT_IDenvironment variables across all CLI commands.Previously, users using CI/CD pipelines had to explicitly pass
--projectId=...as a flag, even if they hadPROJECT_IDexported in their environment (unlikeINFISICAL_TOKENwhich was automatically picked up). This update usesGetCmdFlagOrEnvWithDefaultValueto cleanly fall back to the environment variables if the flag is omitted.