Skip to content

Commit

Permalink
Checks for valid tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
supertopher committed Mar 28, 2022
1 parent 976f8fb commit 83a94ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62923,16 +62923,16 @@ const { retry } = __webpack_require__(86298);
const { throttling } = __webpack_require__(9968);
const _ = __webpack_require__(90250);
const config = __webpack_require__(34570);
const { base64 } = __webpack_require__(84139);
const base64 = __webpack_require__(84139);

let octokit;

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

if (!octokit) {
Expand Down
8 changes: 4 additions & 4 deletions src/gh.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ const { retry } = require('@octokit/plugin-retry');
const { throttling } = require('@octokit/plugin-throttling');
const _ = require('lodash');
const config = require('./config');
const { base64 } = require('js-base64');
const base64 = require('js-base64');

let octokit;

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

if (!octokit) {
Expand Down

0 comments on commit 83a94ed

Please sign in to comment.