An open API service indexing awesome lists of open source software.

https://github.com/casperdcl/ci-env-migrate

Migrate CI environment secrets
https://github.com/casperdcl/ci-env-migrate

Last synced: 12 months ago
JSON representation

Migrate CI environment secrets

Awesome Lists containing this project

README

          

# Migrate env secrets between CI providers

Created mostly to import from Travis to GitHub Actions due to

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

```yaml
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

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

## Usage

```sh
# 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] [...]

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

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