Closed
Description
Since I switched to v4 API, the variables I pass to triggers are ignored. Here is a sample of code:
from httplib import HTTPConnection
HTTPConnection.debuglevel = 2
my_project.trigger_pipeline('gitlabci', 'XXXXX', {'variables[GITLAB_TEST]': 'ThisIsATest'})
From httplib
debug output it's equivalent to:
curl --request POST https://gitlab.com/api/v4/projects/XXXX/trigger/pipeline -H "Content-Type: application/json" -d '{"token": "XXXXX", "ref": "gitlabci", "variables[GITLAB_TEST]": "ThisIsATest"}'
which also ignore variables. Doing the same without JSON does work:
curl --request POST https://gitlab.com/api/v4/projects/XXXX/trigger/pipeline --form token=XXXXX --form ref=gitlabci --form "variables[GITLAB_TEST]=ThisIsATest"
Would it be possible that Gitlab expect the JSON payload to have an other structure ?
Metadata
Metadata
Assignees
Labels
No labels