Skip to content

Commit

Permalink
Authorize requests to Github using workflow temporary token, if avail…
Browse files Browse the repository at this point in the history
…able.
  • Loading branch information
mrclary committed May 23, 2024
1 parent 92c850f commit 42b8e6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spyder/plugins/updatemanager/widgets/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def start_check_update(self, startup=False):
# Fixes spyder-ide/spyder#15839
if self.startup:
self.update_timer = QTimer(self)
self.update_timer.setInterval(60000)
self.update_timer.setInterval(10000)
self.update_timer.setSingleShot(True)
self.sig_block_status_signals.emit(True)
self.update_timer.timeout.connect(
Expand Down
6 changes: 5 additions & 1 deletion spyder/plugins/updatemanager/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ def start(self):

logger.info(f"Checking for updates from {url}")
try:
page = requests.get(url)
headers = {}
token = os.getenv('GITHUB_TOKEN')
if token:
headers.update(Authorization=f"Bearer {token}")
page = requests.get(url, headers=headers)
if url == github_url:
rate_limits(page)
page.raise_for_status()
Expand Down

0 comments on commit 42b8e6f

Please sign in to comment.