mirror of
https://github.com/ad-m/github-push-action.git
synced 2025-06-08 06:27:02 +09:00
Fix passing token to GitHub
This commit is contained in:
parent
821c9b7de9
commit
057a6ba835
1 changed files with 1 additions and 1 deletions
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…
Add table
Add a link
Reference in a new issue