Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message when GitHub token is missing #1182

Merged
merged 2 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions anitya/lib/backends/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ def _retrieve_versions(cls, owner, repo, project):
try:
headers = REQUEST_HEADERS.copy()
token = config["GITHUB_ACCESS_TOKEN"]
if token:
headers["Authorization"] = "bearer %s" % token
if not token:
raise AnityaPluginException("github_access_token not configured")
headers["Authorization"] = "bearer %s" % token
resp = http_session.post(
API_URL,
json={"query": query},
Expand Down
3 changes: 3 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ to the Ansible provisioner inside your `Vagrantfile`::

ansible.extra_vars = { import_production_database: false }

The application's configuration file is ``/home/vagrant/anitya.toml``.
You can also look at the `sample configuration <https://github.com/fedora-infra/anitya/blob/master/files/anitya.toml.sample>`_

.. note::
Please don't commit any local changes to Vagrantfile. We are managing it
upstream.
Expand Down
1 change: 1 addition & 0 deletions news/PR1182.bug
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Better error message when GitHub token is missing