Skip to content

Commit

Permalink
closes #8. closes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanka16 committed May 31, 2022
1 parent aceb33f commit c6d3cdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions folioclient/FolioClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import hashlib
import json
import logging
import os
import random
import re
import traceback
Expand Down Expand Up @@ -224,6 +225,9 @@ def get_latest_from_github(owner, repo, filepath: str, personal_access_token="")
}
if personal_access_token:
github_headers["authorization"] = f"token {personal_access_token}"
elif os.environ.get("GITHUB_TOKEN"):
logging.info("Using GITHB_TOKEN environment variable for Gihub API Access")
github_headers["authorization"] = f"token {os.environ.get('GITHUB_TOKEN')}"
latest_path = f"https://api.github.com/repos/{owner}/{repo}/releases/latest"
req = requests.get(latest_path, headers=github_headers)
req.raise_for_status()
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = folioclient
version = 0.40.2
version = 0.41.0
author = Theodor Tolstoy
author_email = pypi.teddes@tolstoy.se
description = An API wrapper over the FOLIO LSP API Suite OKAPI.
Expand Down

0 comments on commit c6d3cdb

Please sign in to comment.