Skip to content

Commit d2e8a43

Browse files
rounak610claude
andcommitted
fix(setup-env): trim verbose comments per review
Address review feedback on PR #87 (shayan-bstack): reduce the two explanatory comment blocks to the essential rationale, matching the file's existing comment density. Rebuilt dist. No behaviour change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e6365c7 commit d2e8a43

2 files changed

Lines changed: 6 additions & 22 deletions

File tree

‎setup-env/dist/index.js‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34600,9 +34600,7 @@ class ActionInput {
3460034600
this.buildName = core.getInput(INPUT.BUILD_NAME);
3460134601
this.projectName = core.getInput(INPUT.PROJECT_NAME);
3460234602

34603-
// Whether the workflow actually asked us for a name. _validateInput() replaces
34604-
// both fields with generated defaults when they are blank, so the only place
34605-
// this can be observed is here, before validation runs.
34603+
// Capture before _validateInput() replaces blanks with generated defaults.
3460634604
this.buildNameProvided = Boolean(this.buildName && this.buildName.trim());
3460734605
this.projectNameProvided = Boolean(this.projectName && this.projectName.trim());
3460834606
this.githubApp = core.getInput(INPUT.GITHUB_APP);
@@ -34638,14 +34636,8 @@ class ActionInput {
3463834636
core.exportVariable(ENV_VARS.BROWSERSTACK_ACCESS_KEY, this.accessKey);
3463934637
core.info(`Use ${ENV_VARS.BROWSERSTACK_ACCESS_KEY} environment variable for your access key in your tests\n`);
3464034638

34641-
// Only export the name variables when the workflow actually supplied them.
34642-
//
34643-
// Every BrowserStack SDK resolves names as: CLI args > env vars > config file.
34644-
// Exporting a generated default here therefore does not "fill a gap" -- it
34645-
// OUTRANKS whatever the user configured in browserstack.json / browserstack.yml
34646-
// and silently replaces it. Users who want the generated values still get them
34647-
// by opting in with the `BUILD_INFO` and `REPO_NAME` tokens, which
34648-
// InputValidator already understands.
34639+
// Export only when supplied: an env var outranks the user's browserstack.json,
34640+
// so a generated default would silently replace it. BUILD_INFO / REPO_NAME opt in.
3464934641
if (this.projectNameProvided) {
3465034642
core.exportVariable(ENV_VARS.BROWSERSTACK_PROJECT_NAME, this.projectName);
3465134643
core.info(`${ENV_VARS.BROWSERSTACK_PROJECT_NAME} environment variable set as: ${this.projectName}`);

‎setup-env/src/actionInput/index.js‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ class ActionInput {
3333
this.buildName = core.getInput(INPUT.BUILD_NAME);
3434
this.projectName = core.getInput(INPUT.PROJECT_NAME);
3535

36-
// Whether the workflow actually asked us for a name. _validateInput() replaces
37-
// both fields with generated defaults when they are blank, so the only place
38-
// this can be observed is here, before validation runs.
36+
// Capture before _validateInput() replaces blanks with generated defaults.
3937
this.buildNameProvided = Boolean(this.buildName && this.buildName.trim());
4038
this.projectNameProvided = Boolean(this.projectName && this.projectName.trim());
4139
this.githubApp = core.getInput(INPUT.GITHUB_APP);
@@ -71,14 +69,8 @@ class ActionInput {
7169
core.exportVariable(ENV_VARS.BROWSERSTACK_ACCESS_KEY, this.accessKey);
7270
core.info(`Use ${ENV_VARS.BROWSERSTACK_ACCESS_KEY} environment variable for your access key in your tests\n`);
7371

74-
// Only export the name variables when the workflow actually supplied them.
75-
//
76-
// Every BrowserStack SDK resolves names as: CLI args > env vars > config file.
77-
// Exporting a generated default here therefore does not "fill a gap" -- it
78-
// OUTRANKS whatever the user configured in browserstack.json / browserstack.yml
79-
// and silently replaces it. Users who want the generated values still get them
80-
// by opting in with the `BUILD_INFO` and `REPO_NAME` tokens, which
81-
// InputValidator already understands.
72+
// Export only when supplied: an env var outranks the user's browserstack.json,
73+
// so a generated default would silently replace it. BUILD_INFO / REPO_NAME opt in.
8274
if (this.projectNameProvided) {
8375
core.exportVariable(ENV_VARS.BROWSERSTACK_PROJECT_NAME, this.projectName);
8476
core.info(`${ENV_VARS.BROWSERSTACK_PROJECT_NAME} environment variable set as: ${this.projectName}`);

0 commit comments

Comments
 (0)