Skip to content

casperdcl/ci-env-migrate

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Migrate env secrets between CI providers

Created mostly to import from Travis to GitHub Actions due to https://www.jeffgeerling.com/blog/2020/travis-cis-new-pricing-plan-threw-wrench-my-open-source-works

For example, add an API token with repo scope to Travis settings under the env var GH_SECRETS_TOKEN, then replace .travis.yml with:

language: python
jobs:
  include:
  - name: migrate
    python: 3.7
install:
- git clone https://github.com/casperdcl/ci-env-migrate
- pip install -r ci-env-migrate/requirements.txt
script:
- python ci-env-migrate/gh.py $TRAVIS_REPO_SLUG "SOMEVAR=$SOMEVAR"

Install

git clone https://github.com/casperdcl/ci-env-migrate
pip3 install -r ci-env-migrate/requirements.txt

Usage

# to Github Actions
python3 ci-env-migrate/gh.py owner/repo SOMEVAR=secret

$GH_SECRETS_TOKEN must be present and have repo scope.

Usage:
  gh.py [options] <repo> [<secrets>...]

Arguments:
  <repo>  : Repo slug (e.g. casperdcl/test)
  <secrets>  : Secrets (e.g. SOMEVAR=private)

Options:
  -t TOKEN, --token TOKEN  : If unspecified, use `$GH_SECRETS_TOKEN`
  -f FILE, --env-file FILE  : file containing <secrets> (one per line)
  -v, --verbose  : Debug logging

About

Migrate CI environment secrets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages