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.5 to 0.0.6

30

bin/github-secrets.js

@@ -35,3 +35,3 @@ #!/usr/bin/env node

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

@@ -45,4 +45,4 @@ }

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

@@ -79,3 +79,6 @@ )

} catch (err) {
throw Error(`githubRequest failed (status ${err.status}): ${restCmd} ${JSON.stringify(options)}`)
err.extended = {
message: `githubRequest failed (status ${err.status}): ${restCmd} ${JSON.stringify(options)}`
}
throw err
}

@@ -100,2 +103,15 @@ }

async function actionSecret (accessToken, restCmd, verb, options, key) {
try {
await githubRequest(accessToken, restCmd, options)
console.log(`${verb} secret ${key}`)
} catch (err) {
if (err.status && err.status === 404) {
console.log(`secret ${key} does not exist`)
} else {
throw err
}
}
}
async function putSecrets (accessToken, filename, owner, repository) {

@@ -118,3 +134,3 @@ await checkSecretsSupported(accessToken, owner, repository)

const restCmd = `PUT ${path}/{secret_name}`
const parameters = {
const options = {
secret_name: key,

@@ -125,3 +141,3 @@ encrypted_value: encrypt(publicKey, value),

}
await githubRequest(accessToken, restCmd, parameters)
await actionSecret(accessToken, restCmd, 'added', options, key)
}

@@ -149,4 +165,4 @@ }

}
await githubRequest(accessToken, restCmd, options)
await actionSecret(accessToken, restCmd, 'deleted', options, key)
}
}
{
"name": "@neilbmclaughlin/github-secrets",
"version": "0.0.5",
"version": "0.0.6",
"description": "manage git repository secrets",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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