diff --git a/setup-env/action.yml b/setup-env/action.yml index c6d6031..c215028 100644 --- a/setup-env/action.yml +++ b/setup-env/action.yml @@ -20,7 +20,7 @@ inputs: github-app: description: 'BrowserStack Github App' required: false - default: 'browserstack[bot]' + default: 'browserstack-integrations[bot]' runs: using: 'node20' main: 'dist/index.js' diff --git a/setup-env/dist/index.js b/setup-env/dist/index.js index 15bb97d..66c5f98 100644 --- a/setup-env/dist/index.js +++ b/setup-env/dist/index.js @@ -9597,9 +9597,10 @@ class InputValidator { /** * Validates the app name input to ensure it is a valid non-empty string. - * If the input is 'none' or not provided, it returns 'browserstack[bot]'. + * If the input is 'none' or not provided, it returns 'browserstack-integrations[bot]'. * @param {string} githubAppName Input for 'github-app' - * @returns {string} Validated app name, or 'browserstack[bot]' if input is 'none' or invalid + * @returns {string} Validated app name, or 'browserstack-integrations[bot]' + * if input is 'none' or invalid * @throws {Error} If the input is not a valid non-empty string */ static validateGithubAppName(githubAppName) { @@ -9607,8 +9608,8 @@ class InputValidator { throw new Error("Invalid input for 'github-app'. Must be a valid string."); } - if (githubAppName.toLowerCase() === 'browserstack[bot]') { - return 'browserstack[bot]'; + if (githubAppName.toLowerCase() === 'browserstack-integrations[bot]') { + return 'browserstack-integrations[bot]'; } if (githubAppName.trim().length > 0) { diff --git a/setup-env/src/actionInput/inputValidator.js b/setup-env/src/actionInput/inputValidator.js index b6fb275..4eb4c8c 100644 --- a/setup-env/src/actionInput/inputValidator.js +++ b/setup-env/src/actionInput/inputValidator.js @@ -117,9 +117,10 @@ class InputValidator { /** * Validates the app name input to ensure it is a valid non-empty string. - * If the input is 'none' or not provided, it returns 'browserstack[bot]'. + * If the input is 'none' or not provided, it returns 'browserstack-integrations[bot]'. * @param {string} githubAppName Input for 'github-app' - * @returns {string} Validated app name, or 'browserstack[bot]' if input is 'none' or invalid + * @returns {string} Validated app name, or 'browserstack-integrations[bot]' + * if input is 'none' or invalid * @throws {Error} If the input is not a valid non-empty string */ static validateGithubAppName(githubAppName) { @@ -127,8 +128,8 @@ class InputValidator { throw new Error("Invalid input for 'github-app'. Must be a valid string."); } - if (githubAppName.toLowerCase() === 'browserstack[bot]') { - return 'browserstack[bot]'; + if (githubAppName.toLowerCase() === 'browserstack-integrations[bot]') { + return 'browserstack-integrations[bot]'; } if (githubAppName.trim().length > 0) { diff --git a/setup-env/test/actionInput/inputValidator.test.js b/setup-env/test/actionInput/inputValidator.test.js index 168dad6..6e12b93 100644 --- a/setup-env/test/actionInput/inputValidator.test.js +++ b/setup-env/test/actionInput/inputValidator.test.js @@ -154,12 +154,12 @@ describe('InputValidator class to validate individual fields of the action input }); context('Validates GitHub App Name', () => { - it("Returns 'browserstack[bot]' if the app name is not provided", () => { + it("Returns 'browserstack-integrations[bot]' if the app name is not provided", () => { expect(() => InputValidator.validateGithubAppName()).to.throw("Invalid input for 'github-app'. Must be a valid string."); }); - it("Returns 'browserstack[bot]' if the app name is 'browserstack[bot]' (case insensitive)", () => { - expect(InputValidator.validateGithubAppName('BrowserStack[BOT]')).to.eq('browserstack[bot]'); + it("Returns 'browserstack-integrations[bot]' if the app name is 'browserstack-integrations[bot]' (case insensitive)", () => { + expect(InputValidator.validateGithubAppName('BrowserStack-integrations[BOT]')).to.eq('browserstack-integrations[bot]'); }); 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 expect(() => InputValidator.validateGithubAppName(123)).to.throw("Invalid input for 'github-app'. Must be a valid string."); }); - it('Returns the app name if it is a valid non-empty string and not "browserstack[bot]"', () => { + it('Returns the app name if it is a valid non-empty string and not "browserstack-integrations[bot]"', () => { const validAppName = 'someValidAppName'; expect(InputValidator.validateGithubAppName(validAppName)).to.eq(validAppName); });