From ec254d01aecc8ce85a40034ccb994286a7d97b57 Mon Sep 17 00:00:00 2001 From: Matthieu Muffato Date: Fri, 20 Dec 2024 23:34:44 +0000 Subject: [PATCH] Added some documentation --- nf_core/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nf_core/utils.py b/nf_core/utils.py index 6734ab50c0..2ac0943c59 100644 --- a/nf_core/utils.py +++ b/nf_core/utils.py @@ -1097,6 +1097,16 @@ def get_repo_releases_branches(pipeline, wfs): def get_repo_commit(pipeline, commit_id): + """Check if the repo contains the requested commit_id, and expand it to long form if necessary. + + Args: + pipeline (str): GitHub repo username/repo + commit_id: The requested commit ID (SHA). It can be in standard long/short form, or any length. + + Returns: + commit_id: String or None + """ + commit_response = gh_api.get( f"https://api.github.com/repos/{pipeline}/commits/{commit_id}", headers={"Accept": "application/vnd.github.sha"} )