github-secret-dotenv
v1.1.4
Published
upload secrets to github from your .env file
Downloads
23
Maintainers
Readme
Github Secret DotEnv (github-secret-dotenv)
Upload secrets to github from your .env file
Usage
cli
npx github-secret-dotenv \
--repository platane/github-secret-dotenv \
# The github repository (<owner>/<repo>)
# If omitted, read it from the package.json
--dotEnvFilename ./.env \
# The .env file to read
# Default to .env
--githubAccessToken xxxx
# Your github access token
# If omitted, read it from GITHUB_ACCESS_TOKEN env var
# Generate one from https://github.com/settings/tokens/new
# Must have permissions [public_repo read:public_key]
--delete
# When set, remove all secrets that are not in the .env
node api
import { readAndUpload, createSecretUpdater } from "github-secret-dotenv";
// upload the content of .env as secrets for the github repository
await readAndUpload({
owner: "platane",
repo: "github-secret-dotenv",
githubAccessToken: "xxxx",
dotEnvFilename: ".env",
});
// upload arbitrary secret to the github repository
const updateSecret = createSecretUpdater({
owner: "platane",
repo: "github-secret-dotenv",
githubAccessToken: "xxxx",
});
updateSecret("MY_SECRET", "XXXX");