Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Conversation

@HashWarlock
Copy link
Collaborator

No description provided.

@HashWarlock HashWarlock requested a review from Copilot May 25, 2025 19:55
Copy link

Copilot AI left a 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 fixes an environment variables string bug and enhances the test coverage for environment parsing. Key changes include:

  • Adding comprehensive tests for different environment variable formats and scenarios in test/utils/secrets.test.ts.
  • Updating the parseEnv function in src/utils/secrets.ts to correctly strip quotation marks.
  • Bumping version numbers and adding Jest configuration in src/index.ts and package.json.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
test/utils/secrets.test.ts Introduces tests to cover various env variable scenarios.
src/utils/secrets.ts Fixes env var string parsing by stripping quotes from values.
src/index.ts Updates CLI version from v1.0.8 to v1.0.9.
package.json Updates version, adds Jest config, and bumps related dev dependencies.

@HashWarlock HashWarlock merged commit a3273d0 into main May 25, 2025
@HashWarlock HashWarlock mentioned this pull request May 25, 2025
}

// Strip quotation marks from value if present (both single and double quotes)
if (value.length > 1 &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a simple problem and needs more consideration. It's dangerous to strip quotation marks blindly. Consider the two cases

  1. One wrote the quotations but he doesn't mean to
  2. One wrote the quotations and he means to do so

When no striping, 1 doesn't work but 2 works. A simple stripping would enable case 1, but not 2. So, in either way we don't support the both cases.

It turns out this is common and well considered problem. You can read the rule used by dotenv package to learn how it's handled.

In this case, I strongly suggest that instead writing it on our own, we can use the original dotenv package's parse feature to handle it properly

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants