Skip to content

Instantly share code, notes, and snippets.

@mayankshah1607
Created November 11, 2021 07:59
Show Gist options
  • Save mayankshah1607/04d73298130e73571ef191a3515f976e to your computer and use it in GitHub Desktop.
Save mayankshah1607/04d73298130e73571ef191a3515f976e to your computer and use it in GitHub Desktop.
Gitlab verification script
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