diff --git a/.github/workflows/deploy-stg-ecs.yml b/.github/workflows/deploy-stg-ecs.yml index 55c5630b3..d61552d3c 100644 --- a/.github/workflows/deploy-stg-ecs.yml +++ b/.github/workflows/deploy-stg-ecs.yml @@ -3,6 +3,7 @@ on: branches: - "master" - "integration" + - "DOP-4274" concurrency: group: environment-stg-${{ github.ref }} cancel-in-progress: true diff --git a/api/handlers/slack.ts b/api/handlers/slack.ts index d50cf5742..a3cd80ca5 100644 --- a/api/handlers/slack.ts +++ b/api/handlers/slack.ts @@ -24,18 +24,16 @@ export async function buildEntitledBranchList(entitlement: any, repoBranchesRepo const [repoOwner, repoName, directoryPath] = repo.split('/'); const branches = await repoBranchesRepository.getRepoBranches(repoName, directoryPath); for (const branch of branches) { - if ('buildsWithSnooty' in branch) { - const buildWithSnooty = branch['buildsWithSnooty']; - if (buildWithSnooty) { - const active = branch['active']; - const repoPath = `${repoOwner}/${repoName}${directoryPath ? '/' + directoryPath : ''}/${ - branch['gitBranchName'] - }`; - if (!active) { - entitledBranches.push(`!Inactive ` + `${repoPath}`); - } else { - entitledBranches.push(repoPath); - } + const buildWithSnooty = branch['buildsWithSnooty']; + if (buildWithSnooty) { + const active = branch['active']; + const repoPath = `${repoOwner}/${repoName}${directoryPath ? '/' + directoryPath : ''}/${ + branch['gitBranchName'] + }`; + if (!active) { + entitledBranches.push(`!Inactive ` + `${repoPath}`); + } else { + entitledBranches.push(repoPath); } } } diff --git a/src/services/slack.ts b/src/services/slack.ts index 93f405d06..f7c2abaea 100644 --- a/src/services/slack.ts +++ b/src/services/slack.ts @@ -178,10 +178,9 @@ export class SlackConnector implements ISlackConnector { branches.forEach((fullPath) => { const displayBranchPath = fullPath; let valueBranchPath = fullPath; - const inactiveStr = /!inactive/gi; - const isInactive = fullPath.search(inactiveStr); - if (isInactive != -1) { - valueBranchPath = fullPath.slice(10); + const isInactive = fullPath.startsWith('(!inactiveStr)'); + if (isInactive == true) { + valueBranchPath = fullPath.slice(12); } const opt = { text: {