Add try/catch to retrieve authenticated commiter
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
@@ -175,7 +175,12 @@
|
|||||||
throw new Error("You must provide a valid GitHub token to commit your metrics")
|
throw new Error("You must provide a valid GitHub token to commit your metrics")
|
||||||
const rest = github.getOctokit(token)
|
const rest = github.getOctokit(token)
|
||||||
console.log(`Committer REST API | ok`)
|
console.log(`Committer REST API | ok`)
|
||||||
console.log(`Committer | ${(await rest.users.getAuthenticated()).data.login}`)
|
try {
|
||||||
|
console.log(`Committer | ${(await rest.users.getAuthenticated()).data.login}`)
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
console.log(`Committer | (unknown)`)
|
||||||
|
}
|
||||||
//Retrieve previous render SHA to be able to update file content through API
|
//Retrieve previous render SHA to be able to update file content through API
|
||||||
let sha = null
|
let sha = null
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user