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
- Host: GitHub
- URL: https://github.com/casperdcl/ci-env-migrate
- Owner: casperdcl
- Created: 2020-11-10T14:46:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-10T21:07:03.000Z (over 5 years ago)
- Last Synced: 2024-10-11T12:01:21.095Z (over 1 year ago)
- Language: Python
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```