- When running `brew request-bottle`, users who don't have credentials
in the macOS keychain (ie, Linux users) or `HOMEBREW_GITHUB_API_TOKEN`
receive "Error: Not Found" from the GitHub API returning a 404.
- This is cryptic and confusing for newcomers to Linux maintenance, and
potentially confusing to other folks using `open_api` where
credentials are expected yet unset.
- This adds a new `MissingAuthenticationError` to handle the case where
the GitHub API returns 404 and there are no creds yet API scopes are
required.
Before:
```
issyl0@sky:/home/linuxbrew/.linuxbrew/Homebrew$ brew request-bottle hello
==> Dispatching request to Homebrew/linuxbrew-core for hello
Error: Not Found
```
After:
```
issyl0@sky:/home/linuxbrew/.linuxbrew/Homebrew$ brew request-bottle hello
==> Dispatching request to Homebrew/linuxbrew-core for hello
Error: No GitHub credentials found in Keychain or environment.
Create a GitHub personal access token:
https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.profile
```
Since we (and GitHub) no longer support password authentication
using non-token passwords, always set the Authorization header,
rather than needlessly checking for a (possibly incorrect) username.
and allow to skip missing workflows
Can be used like this:
brew pr-pull --workflows=tests.yml,wheezy_tests.yml --ignore-missing-artifacts=wheezy_tests.yml PRNUMBER
- I tried `brew pr-publish` on Linux (as we don't have an auto-merge
Action over there) and it failed with the following error:
```
Error: uninitialized constant Utils::Shell
Please report this issue:
https://docs.brew.sh/Troubleshooting
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:69:in `initialize'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:278:in `exception'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:278:in `raise'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:278:in `raise_api_error'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:228:in `open_api'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:464:in `workflow_dispatch_event'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-publish.rb:43:in `block in pr_publish'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-publish.rb:33:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-publish.rb:33:in `pr_publish'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:119:in `<main>'
```