auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
const CircleCI = require("circleci-api");
const options = {
token: process.env.CIRCLECI_TOKEN,
vcs: {
type: process.env.CIRCLECI_REPOSITORY_PLATFORM,
owner: process.env.CIRCLECI_OWNER,
repo: process.env.CIRCLECI_REPOSITORY,
},
options: {
branch: process.env.CIRCLECI_BRANCH,
filter: "completed",
},
};
const api = new CircleCI.CircleCI(options);
let response = await api.triggerBuild({
options: {
newBuildOptions: {
build_parameters: {
CIRCLE_JOB: process.env.CIRCLECI_JOB,
},
},
},
});
return response
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, params) => {
}
const options = {
subject: params.subject,
text: params.text,
}
if (params.html) {
options.html = params.html
}
if (params.include_collaborators) {
options.include_collaborators = params.include_collaborators
}
$send.email(options)