Fix passing token to GitHub

This commit is contained in:
Adam Dobrawy 2021-01-06 23:37:02 +01:00 committed by GitHub
parent 821c9b7de9
commit 057a6ba835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}