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 - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

22

bin/github-secrets.js
#!/usr/bin/env node
const fs = require('fs')
const chalk = require('chalk')
const readline = require('readline')

@@ -34,4 +35,4 @@ const sodium = require('tweetsodium')

putSecrets(argv.a, argv.filename, argv.o, argv.r)
.then(() => console.log('put successful'))
.catch((err) => console.log(`put failed (${err.message})`))
.then(() => console.log(chalk.green('put successful')))
.catch((err) => console.log(`${chalk.red('put failed')} (${chalk.grey(err.message)})`))
}

@@ -44,4 +45,4 @@ )

deleteSecrets(argv.a, argv.filename, argv.o, argv.r)
.then(() => console.log('delete successful'))
.catch((err) => console.log(`delete failed (${err.message})`))
.then(() => console.log(chalk.green('delete successful')))
.catch((err) => console.log(`${chalk.red('delete failed')} (${chalk.grey(err.message)})`))
}

@@ -93,13 +94,10 @@ )

if (type === 'User') {
console.log(`${owner} is a user and a repository has not been specified.\nSecrets can only be stored for repositorys and organisations. `)
return false
throw Error(`${owner} is a user and a repository has not been specified. Secrets can only be stored for repositorys and organisations.`)
}
}
return true
}
async function putSecrets (accessToken, filename, owner, repository) {
if (!await checkSecretsSupported(accessToken, owner, repository)) {
return
}
await checkSecretsSupported(accessToken, owner, repository)
const { publicKey, publicKeyId } = await getPublicKey(accessToken, owner, repository)

@@ -130,5 +128,3 @@ const fileStream = fs.createReadStream(filename)

async function deleteSecrets (accessToken, filename, owner, repository) {
if (!await checkSecretsSupported(accessToken, owner, repository)) {
return
}
await checkSecretsSupported(accessToken, owner, repository)

@@ -135,0 +131,0 @@ const fileStream = fs.createReadStream(filename)

{
"name": "@neilbmclaughlin/github-secrets",
"version": "0.0.4",
"version": "0.0.5",
"description": "manage git repository secrets",

@@ -12,2 +12,3 @@ "scripts": {

"@octokit/core": "^3.2.4",
"chalk": "^4.1.0",
"readline": "^1.3.0",

@@ -14,0 +15,0 @@ "tweetsodium": "0.0.5",

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