79172789

Date: 2024-11-09 12:49:55
Score: 3
Natty:
Report link

Apparently, I was overcomplicating it with the build request Also, need to provide triggerId instead of trigger name

The updated buildRequest:

const buildRequest = {
    name: `projects/${projectId}/locations/${triggerLocation}/triggers/${triggerId}`,
    source: {
        substitutions: buildSubstitutions
    }
}

Good idea to do a getBuildTrigger if facing a similar issue:

const { CloudBuildClient } = require('@google-cloud/cloudbuild');
const cloudBuildClient = new CloudBuildClient();

const request = {
   name: `projects/${projectId}/locations/${triggerLocation}/triggers/${triggerId}`
};

const response = await cloudBuildClient.getBuildTrigger(request);
console.log(response);
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): facing a similar issue
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Piyush Agarwal