Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neilbmclaughlin/github-secrets

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neilbmclaughlin/github-secrets

manage git repository secrets

  • 2.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

CI NPM Publish NPM Version

Github Secrets

A CLI utility to populate github secrets from a line based text file or stream

Note: version 2.0.0 is a breaking change and no longer works by default with .env format files. See examples below on how to do this in a unix environment

Installation

npm install -g @neilbmclaughlin/github-secrets

Usage

❯ github-secrets --help
github-secrets <cmd> [options]

Commands:
  github-secrets put [filename]     upsert repository secrets from either a file or stdin
  github-secrets delete [filename]  delete repository secrets from either a file or stdin

Options:
  --help     Show help            [boolean]
  --version  Show version number  [boolean]

Examples:
  Put secrets from a file of space separated name-value pairs:
  github-secrets put -a {token} -o {owner} -r {repo} test/data/env2
  Put a single secret:
  echo "foo bar" | github-secrets put -a {token} -o {owner} -r {repo}
  Put secrets from an .env format file with comments filtered out:
  egrep -v '^[ ]*#' test/data/env | github-secrets put -a {token} -o {owner} -r {repo} -s= test/data/env
  Delete secrets from a file:
  cut -f1 -d' ' test/data/env2 | github-secrets delete -a {access} -o {owner} -r {repo}
  Put secrets from a URL (which should not be public!):
  curl -s https://raw.githubusercontent.com/neilbmclaughlin/github-secrets/main/test/data/env2 | github-secrets put -a {token} -o {owner} -r {repo}

Options can also be specified in env vars prepended with 'GITHUB_SECRETS' (e.g. GITHUB_SECRETS_ACCESS_TOKEN, GITHUB_SECRETS_OWNER)

Put Secrets

❯ github-secrets put --help
github-secrets put [filename]

upsert repository secrets from either a file or stdin

Options:
      --help          Show help                                        [boolean]
      --version       Show version number                              [boolean]
  -s, --separator     key-value pair separator                    [default: " "]
  -a, --access-token  Github personal access token                    [required]
  -o, --owner         Github repository owner (defaults to access token owner)
  -r, --repository    Github repository
❯

Delete Secrets

❯ github-secrets delete --help
github-secrets delete [filename]

delete repository secrets from either a file or stdin

Options:
      --help          Show help                                        [boolean]
      --version       Show version number                              [boolean]
  -a, --access-token  Github personal access token                    [required]
  -o, --owner         Github repository owner (defaults to access token owner)
  -r, --repository    Github repository

FAQs

Package last updated on 04 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc