Skip to content

Make Project.trigger_pipeline useable without general authentication #752

Closed
@baurmatt

Description

@baurmatt

Description of the problem, including code/CLI snippet

Gitlab offers Trigger tokens to allow $things to authenticate against the API to only trigger a pipeline. This is currently not possible (or at least I don't see how) with python-gitlab because we first need to authenticate against the Gitlab server.

Expected Behavior

pipeline = gitlab.Project(id).trigger_pipeline('master', token, variables={"DEPLOY": "true"})

Actual Behavior

gl = gitlab.Gitlab('https://gitlab.example-org', private_token=private_token)
project = gl.projects.get(id)
project.trigger_pipeline('master', trigger_token, variables={"DEPLOY": 'true'})

The problem is, that I need to have a valid user account/API token with API privileges to get the project. After that I can use the trigger_token to trigger the pipeline which is kind of counterproductive.

Specifications

  • python-gitlab version: 1.8.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 11.8.6-ee

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions