Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Added the base64 toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
glenndehaan committed Nov 17, 2020
1 parent a8fa6b1 commit 4bfb788
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Usage: github-teams-cli [options] [command]
Options:
-t, --token <value> set the GitHub authentication token
-b, --base64 toggles the secret input to base64
-v, --verbose output extra debugging
-h, --help display help for command
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
],
"dependencies": {
"@octokit/core": "^3.2.1",
"atob": "^2.1.2",
"commander": "^6.2.0",
"eslint": "^7.13.0",
"pkg": "^4.4.9",
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Import vendor modules
*/
const program = require('commander');
const atob = require('atob');

/**
* Import own modules
Expand All @@ -26,6 +27,7 @@ program.name('github-teams-cli');
*/
program
.requiredOption('-t, --token <value>', 'set the GitHub authentication token')
.option('-b, --base64', 'toggles the secret input to base64')
.option('-v, --verbose', 'output extra debugging');

/**
Expand Down Expand Up @@ -56,7 +58,9 @@ program
subcommand = true;
verbose(program.verbose);
github(program.token);
actions.addSecret(org, repository, name, secret);

const secretPass = program.base64 ? atob(secret) : secret;
actions.addSecret(org, repository, name, secretPass);
});

/**
Expand Down

0 comments on commit 4bfb788

Please sign in to comment.