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

Commit 4bfb788

Browse files
committed
Added the base64 toggle
1 parent a8fa6b1 commit 4bfb788

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Usage: github-teams-cli [options] [command]
2323
2424
Options:
2525
-t, --token <value> set the GitHub authentication token
26+
-b, --base64 toggles the secret input to base64
2627
-v, --verbose output extra debugging
2728
-h, --help display help for command
2829

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
],
4444
"dependencies": {
4545
"@octokit/core": "^3.2.1",
46+
"atob": "^2.1.2",
4647
"commander": "^6.2.0",
4748
"eslint": "^7.13.0",
4849
"pkg": "^4.4.9",

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Import vendor modules
33
*/
44
const program = require('commander');
5+
const atob = require('atob');
56

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

3133
/**
@@ -56,7 +58,9 @@ program
5658
subcommand = true;
5759
verbose(program.verbose);
5860
github(program.token);
59-
actions.addSecret(org, repository, name, secret);
61+
62+
const secretPass = program.base64 ? atob(secret) : secret;
63+
actions.addSecret(org, repository, name, secretPass);
6064
});
6165

6266
/**

0 commit comments

Comments
 (0)