Skip to content

Instantly share code, notes, and snippets.

@rodrigosiviero
Created January 22, 2020 12:47
Show Gist options
  • Select an option

  • Save rodrigosiviero/a1c90a1509b2a6a45e0686c9732b170b to your computer and use it in GitHub Desktop.

Select an option

Save rodrigosiviero/a1c90a1509b2a6a45e0686c9732b170b to your computer and use it in GitHub Desktop.
import os
import gitlab
#Creates a Gitlab Connection object, you must create your token on Gitlab
gl = gitlab.Gitlab('https://gitlab.example.com/gitlab', private_token=os.environ['your_token'])
#Creates a function to get the project internal ID from the CI.
def get_project(project_id):
return gl.projects.get(project_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment