https://github.com/platane/github-secret-dotenv
🗝 upload secrets to github from your .env file
https://github.com/platane/github-secret-dotenv
cli dotenv github github-actions github-secrets secrets
Last synced: 3 months ago
JSON representation
🗝 upload secrets to github from your .env file
- Host: GitHub
- URL: https://github.com/platane/github-secret-dotenv
- Owner: Platane
- License: mit
- Created: 2020-02-11T01:50:50.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T20:53:24.000Z (almost 2 years ago)
- Last Synced: 2025-04-16T00:11:53.899Z (3 months ago)
- Topics: cli, dotenv, github, github-actions, github-secrets, secrets
- Language: TypeScript
- Homepage: https://npmjs.com/package/github-secret-dotenv
- Size: 630 KB
- Stars: 12
- Watchers: 3
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Github Secret DotEnv _(github-secret-dotenv)_


[](https://www.npmjs.com/package/github-secret-dotenv)
[](https://github.com/Platane/github-secret-dotenv/actions?query=workflow%3Amain)> Upload secrets to github from your .env file

# Usage
## cli
```sh
npx github-secret-dotenv \--repository platane/github-secret-dotenv \
# The github repository (/)
# 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
```typescript
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");
```# License
[MIT](./LICENSE)