From 5f1e71d291b5d7d26d1bc3601d67889df9dc5089 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 3 Oct 2023 15:01:07 +0200 Subject: [PATCH 1/3] switch to safe_get for all github requests --- nf_core/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nf_core/utils.py b/nf_core/utils.py index 3f7d9693b1..b48d348892 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -480,6 +480,8 @@ def __call__(self, r): if os.environ.get("GITHUB_TOKEN") is not None and self.auth is None: self.auth_mode = "Bearer token with GITHUB_TOKEN" self.auth = BearerAuth(os.environ["GITHUB_TOKEN"]) + else: + log.warning("Could not find GitHub authentication token. Some API requests may fail.") log.debug(f"Using GitHub auth: {self.auth_mode}") @@ -509,6 +511,7 @@ def safe_get(self, url): """ if not self.has_init: self.lazy_init() + log.critical(url) request = self.get(url) if request.status_code in self.return_retry: stderr = rich.console.Console(stderr=True, force_terminal=rich_force_colors()) @@ -833,7 +836,7 @@ def prompt_remote_pipeline_name(wfs): # Non nf-core repo on GitHub if pipeline.count("/") == 1: try: - gh_api.get(f"https://api.github.com/repos/{pipeline}") + gh_api.safe_get(f"https://api.github.com/repos/{pipeline}") except Exception: # No repo found - pass and raise error at the end pass From 53d7eb9c0b24fe6b98026a4cf1f3f89a3ab9cfc7 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 3 Oct 2023 15:12:04 +0200 Subject: [PATCH 2/3] remove debugging --- nf_core/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nf_core/utils.py b/nf_core/utils.py index b48d348892..8290ed1780 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -511,7 +511,6 @@ def safe_get(self, url): """ if not self.has_init: self.lazy_init() - log.critical(url) request = self.get(url) if request.status_code in self.return_retry: stderr = rich.console.Console(stderr=True, force_terminal=rich_force_colors()) From 0809c1757b501c9bddc7022e1f06a2140cdf8ba2 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 3 Oct 2023 15:19:38 +0200 Subject: [PATCH 3/3] add github token to CI --- .github/workflows/create-test-lint-wf-template.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 302399b3dc..2689805dd1 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -16,6 +16,7 @@ concurrency: env: NXF_ANSI_LOG: false + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: RunTestWorkflow: