Created
May 24, 2020 06:28
-
-
Save adrianalonso/0d01b12a98f4fd6e80e48f3fd44dea7d to your computer and use it in GitHub Desktop.
Revisions
-
adrianalonso created this gist
May 24, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ 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; };