Skip to content

Commit d2f3cba

Browse files
authored
Merge pull request #44 from browserstack/O11y-ReRun-Name-Update
feat(gha): github app name update
2 parents 46f0c85 + acfb835 commit d2f3cba

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

Diff for: setup-env/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inputs:
2020
github-app:
2121
description: 'BrowserStack Github App'
2222
required: false
23-
default: 'browserstack[bot]'
23+
default: 'browserstack-integrations[bot]'
2424
runs:
2525
using: 'node20'
2626
main: 'dist/index.js'

Diff for: setup-env/dist/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -9597,18 +9597,19 @@ class InputValidator {
95979597

95989598
/**
95999599
* Validates the app name input to ensure it is a valid non-empty string.
9600-
* If the input is 'none' or not provided, it returns 'browserstack[bot]'.
9600+
* If the input is 'none' or not provided, it returns 'browserstack-integrations[bot]'.
96019601
* @param {string} githubAppName Input for 'github-app'
9602-
* @returns {string} Validated app name, or 'browserstack[bot]' if input is 'none' or invalid
9602+
* @returns {string} Validated app name, or 'browserstack-integrations[bot]'
9603+
* if input is 'none' or invalid
96039604
* @throws {Error} If the input is not a valid non-empty string
96049605
*/
96059606
static validateGithubAppName(githubAppName) {
96069607
if (typeof githubAppName !== 'string') {
96079608
throw new Error("Invalid input for 'github-app'. Must be a valid string.");
96089609
}
96099610

9610-
if (githubAppName.toLowerCase() === 'browserstack[bot]') {
9611-
return 'browserstack[bot]';
9611+
if (githubAppName.toLowerCase() === 'browserstack-integrations[bot]') {
9612+
return 'browserstack-integrations[bot]';
96129613
}
96139614

96149615
if (githubAppName.trim().length > 0) {

Diff for: setup-env/src/actionInput/inputValidator.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,19 @@ class InputValidator {
117117

118118
/**
119119
* Validates the app name input to ensure it is a valid non-empty string.
120-
* If the input is 'none' or not provided, it returns 'browserstack[bot]'.
120+
* If the input is 'none' or not provided, it returns 'browserstack-integrations[bot]'.
121121
* @param {string} githubAppName Input for 'github-app'
122-
* @returns {string} Validated app name, or 'browserstack[bot]' if input is 'none' or invalid
122+
* @returns {string} Validated app name, or 'browserstack-integrations[bot]'
123+
* if input is 'none' or invalid
123124
* @throws {Error} If the input is not a valid non-empty string
124125
*/
125126
static validateGithubAppName(githubAppName) {
126127
if (typeof githubAppName !== 'string') {
127128
throw new Error("Invalid input for 'github-app'. Must be a valid string.");
128129
}
129130

130-
if (githubAppName.toLowerCase() === 'browserstack[bot]') {
131-
return 'browserstack[bot]';
131+
if (githubAppName.toLowerCase() === 'browserstack-integrations[bot]') {
132+
return 'browserstack-integrations[bot]';
132133
}
133134

134135
if (githubAppName.trim().length > 0) {

Diff for: setup-env/test/actionInput/inputValidator.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ describe('InputValidator class to validate individual fields of the action input
154154
});
155155

156156
context('Validates GitHub App Name', () => {
157-
it("Returns 'browserstack[bot]' if the app name is not provided", () => {
157+
it("Returns 'browserstack-integrations[bot]' if the app name is not provided", () => {
158158
expect(() => InputValidator.validateGithubAppName()).to.throw("Invalid input for 'github-app'. Must be a valid string.");
159159
});
160160

161-
it("Returns 'browserstack[bot]' if the app name is 'browserstack[bot]' (case insensitive)", () => {
162-
expect(InputValidator.validateGithubAppName('BrowserStack[BOT]')).to.eq('browserstack[bot]');
161+
it("Returns 'browserstack-integrations[bot]' if the app name is 'browserstack-integrations[bot]' (case insensitive)", () => {
162+
expect(InputValidator.validateGithubAppName('BrowserStack-integrations[BOT]')).to.eq('browserstack-integrations[bot]');
163163
});
164164

165165
it('Throws an error if the app name is an empty string', () => {
@@ -170,7 +170,7 @@ describe('InputValidator class to validate individual fields of the action input
170170
expect(() => InputValidator.validateGithubAppName(123)).to.throw("Invalid input for 'github-app'. Must be a valid string.");
171171
});
172172

173-
it('Returns the app name if it is a valid non-empty string and not "browserstack[bot]"', () => {
173+
it('Returns the app name if it is a valid non-empty string and not "browserstack-integrations[bot]"', () => {
174174
const validAppName = 'someValidAppName';
175175
expect(InputValidator.validateGithubAppName(validAppName)).to.eq(validAppName);
176176
});

0 commit comments

Comments
 (0)