/circleci-api-helper

:package: Node.js util helper for CircleCI workflow runner API (v2)

Primary LanguageJavaScriptMIT LicenseMIT

Node.js helper 📦 for CircleCI API (v2)

npm version CircleCI tested with jest Downloads License: MIT

Background

This util allows you to trigger circleci workflows within a node js application. You can run specific workflow as part of circleci api v2

Install

yarn add circleci-api-helper

How to use

Files in CI or local that the helper uses for requests to the CircelCI API (v2)

/utils/circleToken.js (Required)
/utils/projectSlug.js (Required)
/utils/workflowName.js (Required)
/utils/workflowID.js

Example values

circleToken: FAKEGUID3adas23d69e532432d3x1f534852fs52
projectSlug: gh/johnhiggs/circleci-api-helper
workflowName: default-flow

Trigger workflow

(auto generates latest workflow ID based off of required values (requires circleToken, projectSlug, & workflowName)

yarn runWorkflow

Rerun existing workflow

Simply rerun an existing workflow (set a value to /utils/workflowID.js) yarn runSpecificWorkflow