| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Warning
This PR introduces a small abstraction layer over environment access to avoid hard-coding process.env in places that need to be testable, and begins standardizing GitHub Actions environment variable names via an enum.
Changes:
| File | Description |
|---|---|
| src/util.ts | Adds Env adapter and env accessor helpers that can take a NodeJS.ProcessEnv. |
| src/environment.ts | Defines the new Env interface used to abstract environment lookups. |
| src/testing-utils.ts | Adds a test helper for creating an Env and tightens typing for default Actions env vars. |
| src/actions-util.ts | Introduces ActionsEnvVars enum and replaces some raw env var strings with enum constants. |
| src/api-client.ts | Updates env-var lookups to use ActionsEnvVars constants. |
| lib/entry-points.js | Changed but excluded from diff (and typically generated output). |
src/util.ts:588
const value = env[paramName];
if (value === undefined || value.length === 0) {
throw new Error(`${paramName} environment variable must be set`);
}
return value;
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM 👍🏻
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Two straight-forward commits cherry-picked from #3990 (and, in turn, #3973) which add an Env interface that allows us to abstract over process.env so that tests don't have to run synchronously because they query process.env and can instead query a test-specific environment.
Not used in this PR, but cherry-picked so that we can hopefully merge it relatively quickly and make use of it elsewhere.
Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Environments:
How did/will you validate this change?
If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist