Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F25451141
gitlab.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
673 B
Referenced Files
None
Subscribers
None
gitlab.py
View Options
# -------------------------------------------------------------
# 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
Details
Attached
Mime Type
text/x-python
Expires
Thu, Apr 16, 05:02 (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3606708
Default Alt Text
gitlab.py (673 B)
Attached To
Mode
rRESOLVEHASH Resolve hash
Attached
Detach File
Event Timeline
Log In to Comment