Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 2 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T20:53:24.000Z (over 1 year ago)
- Last Synced: 2024-10-05T16:43:19.754Z (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: 4
- 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)_
![type definitions](https://img.shields.io/npm/types/typescript?style=flat-square)
![code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)
[![npm](https://img.shields.io/npm/v/github-secret-dotenv?style=flat-square)](https://www.npmjs.com/package/github-secret-dotenv)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Platane/github-secret-dotenv/main?style=flat-square&label=test)](https://github.com/Platane/github-secret-dotenv/actions?query=workflow%3Amain)> Upload secrets to github from your .env file
![terminal screenshot](./doc/terminal-screenshot.png)
# 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)