Created
November 11, 2021 07:59
-
-
Save mayankshah1607/04d73298130e73571ef191a3515f976e to your computer and use it in GitHub Desktop.
Gitlab verification script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gitlab | |
gl = gitlab.Gitlab('https://gitlab.cee.redhat.com/', private_token='', ssl_verify=False) | |
gl.auth() | |
project = gl.projects.get() # Enter project ID here | |
data = { | |
'branch': 'main', | |
'commit_message': 'Test commit', | |
'actions': [ | |
{ | |
'action': 'create', | |
'file_path': 'dir1/dir2/file.txt', | |
'content': open('/Users/mayank/Desktop/work/test/test').read(), | |
}, | |
] | |
} | |
commit = project.commits.create(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment