Deletes and recreates CircleCI (and associated GitHub) deploy keys.
CIRCLECI_ORG, CIRCLECI_REPOS (comma-separated), CIRCLE_TOKEN and GITHUB_TOKEN (to clean up associated GitHub deploy keys) env vars must be set.
-
Clone this repo.
-
Install by running
npm install --globalfrom within the root directory. -
Set the required environment variables.
export CIRCLECI_ORG=my-org export CIRCLECI_REPOS=my-repo1,my-repo2 export CIRCLECI_TOKEN=my-personal-circleci-token export GITHUB_TOKEN=my-personal-github-token
-
Run
rotate-circleci-deploy-keys.
Tada! 🎉