@vivianhealth/circleci-restart-workflow
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

circleci-restart-workflow

This utility uses the CirlceCI V2 API to cancel a workflow running for a specific HEAD commit on a specific branch if it's running and then restart it (regardless of it was already running or not).

Main use is to rerun a workflow for a branch after a PR is created in GitHub so that workflow can run with a freshly set CIRCLE_PULL_REQUEST environment variable.

Prerequisites

  • Node >=18

Usage

The following command will allow you run the CLI tool without having to explicitly install it as long as npm is installed.

npx -y -p @vivianhealth/circleci-restart-workflow@latest \
    circleci-restart-workflow \
    --commit-sha <commit-sha> \
    --branch <branch>

To install and lock in a specific version into your project dependencies (recommended):

npm install --save-dev @vivianhealth/circleci-restart-workflow

And then to run the CLI tool inside your project directory:

npx circleci-restart-workflow \
    --commit-sha <commit-sha> \
    --branch <branch>

Publishing

This package is automatically published to npm via CI. Versions are bumped automatically based on commits since the last release using semantic-release and conventional-changelog.

Commit message format is important. See conventional commits. This format is enforced via git hooks.

License

This package is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i @vivianhealth/circleci-restart-workflow

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

35 kB

Total Files

16

Last publish

Collaborators

  • vivian-infra-bot