I trigger my pipeline from Github etc.
https://gitlab.com/api/v4/projects/12345678/ref/main/trigger/pipeline?token=glptt-237c8123836c85b299ff6d99f3dd12827c23de94
with payload
{
"ref": "refs/heads/test-branch",
"before": "515817106e7b9ca89413499881c6a0846fe06ddd",
"after": "03288450030a3d1db34c144c28b38f563adeff95",
"repository": { ... }
...
But inside the Gitlab pipeline I see
cat $TRIGGER_PAYLOAD
{
"ref":"main",
"before":"515817106e7b9ca89413499881c6a0846fe06ddd",
"after":"03288450030a3d1db34c144c28b38f563adeff95",
"repository":{ ... }
...
}
Why do you rewrite initial payload and how can I see my initial ref?
Looks like a bug and you shouldn’t touch the data you receive externally.
Configuration
stages:
- setup
setup:
stage: setup
image: alpine
script:
- cat $TRIGGER_PAYLOAD
Versions
- Self-managed
- GitLab.com SaaS
- Self-hosted Runners