Skip to content

Commit

Permalink
Adds logic to not always decode base64
Browse files Browse the repository at this point in the history
  • Loading branch information
supertopher committed Mar 28, 2022
1 parent b166f5d commit 27652e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gh.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ const { base64 } = require('js-base64');
let octokit;

function getOctokit(token) {
token = base64.decode(token)
if (base64.isValid("topher")) {
core.info("base64 decoding")
token = base64.decode(token)
} else {
core.info("base64 not detected")
}

if (!octokit) {
const ConfiguredOctokit = Octokit.plugin(retry, throttling);
octokit = new ConfiguredOctokit(getOctokitOptions(token, {
Expand Down

0 comments on commit 27652e4

Please sign in to comment.