Fix passing token to GitHub
This commit is contained in:
parent
821c9b7de9
commit
057a6ba835
2
start.js
2
start.js
@ -46,7 +46,7 @@ const main = async () => {
|
||||
const headers = {
|
||||
'User-Agent': 'github.com/ad-m/github-push-action'
|
||||
};
|
||||
if (process.env.GITHUB_TOKEN) headers.Authorization = `token ${process.env.GITHUB_TOKEN}`;
|
||||
if (process.env.INPUT_GITHUB_TOKEN) headers.Authorization = `token ${process.env.INPUT_GITHUB_TOKEN}`;
|
||||
const body = JSON.parse(await get(`https://api.github.com/repos/${repository}`, { headers }))
|
||||
branch = body.default_branch;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user