Add support for bot token

This commit is contained in:
lowlighter
2020-10-09 13:53:03 +02:00
parent 3c6704f2c6
commit 12f6c1abf3
8 changed files with 89 additions and 10189 deletions

9629
action/dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -21,6 +21,7 @@
//Initialization
const [token, user, filename, debug] = [core.getInput("token"), core.getInput("user"), core.getInput("filename", {default:"github-metrics.svg"}), core.getInput("debug", {default:false})]
const committer = core.getInput("committer_token", {default:null}) || token
const output = path.join(filename)
console.log(`GitHub user | ${user}`)
console.log(`Output file | ${output}`)
@@ -28,7 +29,7 @@
if (!token)
throw new Error("You must provide a valid GitHub token")
const graphql = octokit.graphql.defaults({headers:{authorization: `token ${token}`}})
const rest = github.getOctokit(token)
const rest = github.getOctokit(committer)
//Debug mode
if (!debug)