From b537898d64f754dcb3aeb1f521b62eb4f6ad1a46 Mon Sep 17 00:00:00 2001 From: Akshit Sharma Date: Tue, 24 Sep 2024 16:02:04 +0530 Subject: [PATCH] feat(gha): staging changes --- setup-env/config/constants.js | 2 +- setup-env/dist/index.js | 11 ++++++----- setup-env/src/actionInput/inputValidator.js | 9 +++++---- setup-env/test/actionInput/inputValidator.test.js | 8 ++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/setup-env/config/constants.js b/setup-env/config/constants.js index 372fda7..e3c47da 100644 --- a/setup-env/config/constants.js +++ b/setup-env/config/constants.js @@ -16,6 +16,6 @@ module.exports = { }, BROWSERSTACK_INTEGRATIONS: { - DETAILS_API_URL: 'https://integrate.browserstack.com/api/ci-tools/v1/builds/{runId}/rebuild/details?tool=github-actions&as_bot=true', + DETAILS_API_URL: 'https://integrate.bsstag.com/api/ci-tools/v1/builds/{runId}/rebuild/details?tool=github-actions&as_bot=true', }, }; diff --git a/setup-env/dist/index.js b/setup-env/dist/index.js index 15bb97d..40f753c 100644 --- a/setup-env/dist/index.js +++ b/setup-env/dist/index.js @@ -22,7 +22,7 @@ module.exports = { }, BROWSERSTACK_INTEGRATIONS: { - DETAILS_API_URL: 'https://integrate.browserstack.com/api/ci-tools/v1/builds/{runId}/rebuild/details?tool=github-actions&as_bot=true', + DETAILS_API_URL: 'https://integrate.bsstag.com/api/ci-tools/v1/builds/{runId}/rebuild/details?tool=github-actions&as_bot=true', }, }; @@ -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 'bstack-integrations-staging[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 'bstack-integrations-staging[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() === 'bstack-integrations-staging[bot]') { + return 'bstack-integrations-staging[bot]'; } if (githubAppName.trim().length > 0) { diff --git a/setup-env/src/actionInput/inputValidator.js b/setup-env/src/actionInput/inputValidator.js index b6fb275..f4a5ac9 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 'bstack-integrations-staging[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 'bstack-integrations-staging[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() === 'bstack-integrations-staging[bot]') { + return 'bstack-integrations-staging[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..025b4ec 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 'bstack-integrations-staging[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 'bstack-integrations-staging[bot]' if the app name is 'bstack-integrations-staging[bot]' (case insensitive)", () => { + expect(InputValidator.validateGithubAppName('Bstack-integrations-staging[BOT]')).to.eq('bstack-integrations-staging[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 "bstack-integrations-staging[bot]"', () => { const validAppName = 'someValidAppName'; expect(InputValidator.validateGithubAppName(validAppName)).to.eq(validAppName); });