Page MenuHomeDevCentral

gitlab.py
No OneTemporary

gitlab.py

# -------------------------------------------------------------
# Resolve hash :: VCS :: GitLab
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Description: Search hash on GitLab
# License: BSD-2-Clause
# -------------------------------------------------------------
import requests
def query_gitlab_instance(instance, token, commit_hash):
url = f"{instance}api/v4/search?scope=commits&search={commit_hash}"
r = requests.get(url, headers={"PRIVATE-TOKEN": token})
if r.status_code == 200:
return None
commits = r.json()
if commits:
return commits[0]["web_url"]

File Metadata

Mime Type
text/x-python
Expires
Thu, Apr 16, 05:02 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3606708
Default Alt Text
gitlab.py (673 B)

Event Timeline