From e4776093c03c6a7d66a59c1273b4855f4b903f35 Mon Sep 17 00:00:00 2001 From: Ruslan Sayfutdinov Date: Fri, 3 Nov 2023 15:18:30 +0000 Subject: [PATCH] Update github auth in publish script (#781) --- script/publish_release.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/publish_release.py b/script/publish_release.py index f8a08e6ae..0bf451762 100644 --- a/script/publish_release.py +++ b/script/publish_release.py @@ -7,7 +7,7 @@ import os import sys -from github import Github, InputGitTreeElement +from github import Auth, Github, InputGitTreeElement from github.ContentFile import ContentFile from github.GitRelease import GitRelease from github.Repository import Repository @@ -16,8 +16,9 @@ def main() -> int: """Main function""" github_token = os.environ.get("GITHUB_TOKEN") + assert github_token is not None, "GITHUB_TOKEN is not set" print("Fetching draft release...") - github = Github(github_token) + github = Github(auth=Auth.Token(github_token)) repo = github.get_repo("leikoilja/ha-google-home") release = repo.get_releases()[0] if not release.draft: