Provide an input for github tokens (#172)

* Provide an input for github tokens

- By providing an input for github tokens with a default users no longer have to pass
  the github token via their environment across workflows.
- Remove GITHUB_TOKEN from our environment in all workflows

* Don't run workflows on main on pull requests

Co-authored-by: Paulo F. Oliveira <paulo.ferraz.oliveira@gmail.com>
This commit is contained in:
Bryan Paxton
2023-01-06 10:14:27 -06:00
committed by GitHub
parent 81d8403713
commit e3f6ffe287
7 changed files with 22 additions and 21 deletions
+5 -2
View File
@@ -7612,9 +7612,12 @@ async function get(url0, pageIdxs) {
const headers = {
'user-agent': 'setup-beam',
}
if (process.env.GITHUB_TOKEN) {
headers.authorization = `Bearer ${process.env.GITHUB_TOKEN}`
const GithubToken = getInput('github-token', false)
if (GithubToken) {
headers.authorization = `Bearer ${GithubToken}`
}
if (pageIdx !== null) {
url.searchParams.append('page', pageIdx)
}