diff --git a/api/controllers/v2/github.ts b/api/controllers/v2/github.ts index 0f92f7eea..61035ae2b 100644 --- a/api/controllers/v2/github.ts +++ b/api/controllers/v2/github.ts @@ -88,10 +88,10 @@ async function createPayload({ } action = 'push'; jobType = 'githubPush'; - branchName = githubEvent.ref.split('/')[2]; - url = githubEvent.repository.clone_url; + branchName = githubEvent.ref?.split('/')[2]; + url = githubEvent.repository?.clone_url; newHead = githubEvent.after; - repoOwner = githubEvent.repository.owner.login; + repoOwner = githubEvent.repository?.owner.login; } const branchInfo = await repoBranchesRepository.getRepoBranchAliases(repoName, branchName, repoInfo.project); @@ -174,18 +174,18 @@ export const triggerSmokeTestAutomatedBuild = async (event: APIGatewayEvent): Pr ' completed successfully but only Deploy Staging ECS workflow completion will trigger smoke test site deployments', }; - // if the build was not building master, no need for smoke test sites - if (body.workflow_run.head_branch != 'main' || body.repository.fork) { - console.log('Build was not on master branch in main repo, sites will not deploy as no smoke tests are needed'); - return { - statusCode: 202, - headers: { 'Content-Type': 'text/plain' }, - body: - 'Build on branch ' + - body.workflow_run.head_branch + - ' will not trigger site deployments as it was not on master branch in upstream repo', - }; - } + // // if the build was not building master, no need for smoke test sites + // if (body.workflow_run.head_branch != 'main' || body.repository.fork) { + // console.log('Build was not on master branch in main repo, sites will not deploy as no smoke tests are needed'); + // return { + // statusCode: 202, + // headers: { 'Content-Type': 'text/plain' }, + // body: + // 'Build on branch ' + + // body.workflow_run.head_branch + + // ' will not trigger site deployments as it was not on master branch in upstream repo', + // }; + // } //automated test builds will always deploy in dotcomstg const env = 'dotcomstg';