Use github.context.repo instead of username
This commit is contained in:
8
action/dist/index.js
vendored
8
action/dist/index.js
vendored
@@ -926,17 +926,13 @@ var E_Users_lecoq_Documents_GitHub_gitstats_node_modules_actions_github_lib_gith
|
|||||||
//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 {
|
||||||
const {data} = await rest.repos.getContent({
|
const {data} = await rest.repos.getContent({owner:user, repo:github.context.repo, path:filename})
|
||||||
owner:user,
|
|
||||||
repo:user,
|
|
||||||
path:filename,
|
|
||||||
})
|
|
||||||
sha = data.sha
|
sha = data.sha
|
||||||
} catch (error) { console.debug(error) }
|
} catch (error) { console.debug(error) }
|
||||||
console.log(`Previous render sha | ${sha || "none"}`)
|
console.log(`Previous render sha | ${sha || "none"}`)
|
||||||
//Update file content through API
|
//Update file content through API
|
||||||
await rest.repos.createOrUpdateFileContents({
|
await rest.repos.createOrUpdateFileContents({
|
||||||
owner:user, repo:user, path:filename, message:`Update ${filename} - [Skip GitHub Action]`,
|
owner:user, repo:github.context.repo, path:filename, message:`Update ${filename} - [Skip GitHub Action]`,
|
||||||
content:Buffer.from(rendered).toString("base64"),
|
content:Buffer.from(rendered).toString("base64"),
|
||||||
...(sha ? {sha} : {})
|
...(sha ? {sha} : {})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -132,17 +132,13 @@
|
|||||||
//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 {
|
||||||
const {data} = await rest.repos.getContent({
|
const {data} = await rest.repos.getContent({owner:user, repo:github.context.repo, path:filename})
|
||||||
owner:user,
|
|
||||||
repo:user,
|
|
||||||
path:filename,
|
|
||||||
})
|
|
||||||
sha = data.sha
|
sha = data.sha
|
||||||
} catch (error) { console.debug(error) }
|
} catch (error) { console.debug(error) }
|
||||||
console.log(`Previous render sha | ${sha || "none"}`)
|
console.log(`Previous render sha | ${sha || "none"}`)
|
||||||
//Update file content through API
|
//Update file content through API
|
||||||
await rest.repos.createOrUpdateFileContents({
|
await rest.repos.createOrUpdateFileContents({
|
||||||
owner:user, repo:user, path:filename, message:`Update ${filename} - [Skip GitHub Action]`,
|
owner:user, repo:github.context.repo, path:filename, message:`Update ${filename} - [Skip GitHub Action]`,
|
||||||
content:Buffer.from(rendered).toString("base64"),
|
content:Buffer.from(rendered).toString("base64"),
|
||||||
...(sha ? {sha} : {})
|
...(sha ? {sha} : {})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user