Fix wrong token use
This commit is contained in:
2
action/dist/index.js
vendored
2
action/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -29,7 +29,7 @@
|
|||||||
if (!token)
|
if (!token)
|
||||||
throw new Error("You must provide a valid GitHub token")
|
throw new Error("You must provide a valid GitHub token")
|
||||||
const graphql = octokit.graphql.defaults({headers:{authorization: `token ${token}`}})
|
const graphql = octokit.graphql.defaults({headers:{authorization: `token ${token}`}})
|
||||||
const rest = github.getOctokit(committer)
|
const rest = github.getOctokit(token)
|
||||||
|
|
||||||
//Debug mode
|
//Debug mode
|
||||||
if (!debug)
|
if (!debug)
|
||||||
@@ -54,6 +54,8 @@
|
|||||||
console.log(`Render | complete`)
|
console.log(`Render | complete`)
|
||||||
|
|
||||||
//Commit to repository
|
//Commit to repository
|
||||||
|
{
|
||||||
|
const rest = github.getOctokit(committer)
|
||||||
let sha = undefined
|
let sha = undefined
|
||||||
try {
|
try {
|
||||||
const {data} = await rest.repos.getContent({
|
const {data} = await rest.repos.getContent({
|
||||||
@@ -69,6 +71,7 @@
|
|||||||
content:Buffer.from(rendered).toString("base64"),
|
content:Buffer.from(rendered).toString("base64"),
|
||||||
})
|
})
|
||||||
console.log(`Commit to repo | ok`)
|
console.log(`Commit to repo | ok`)
|
||||||
|
}
|
||||||
|
|
||||||
//Success
|
//Success
|
||||||
console.log(`Success !`)
|
console.log(`Success !`)
|
||||||
|
|||||||
Reference in New Issue
Block a user