Hello everyone, is there a recommended way to deal...
# general
t
Hello everyone, is there a recommended way to deal with Branches in Tag Pipelines? The GitLab Tag Pipelines have no branch name set. From what I have come up with I have two options: 1. Use the default branch name (which the tags are always made on). Then in validation pipelines that are triggered by webhooks I can check that out and reset to the tag. 2. Use no branch name. In webhook pipelines I would then checkout the tag detached. Are there any more consequences in using one or the other?
Correction: I cannot use the default branch to publish the tag results, because patches are tagged on other branches. However, as I've just seen that the contract_requiring_verification_published Pipeline requires the branch to be set (though I'm not sure that is actually enforced) I'm probably just going to use the Tag name as the branch name as well.
m
sorry for the delay. Is a Tag Pipeline a GitLab specific thing (this?) I think you’re right, though. If you can’t get the branch, the simplest option might be to dual publish. You could potentially use tags in PactFlow/Broker, and then query the API to navigate to the related branch. That’s probably doable
t
Sorry, didn't look here again, because currently I seem to be fine with just using the tag version as the branch name. > sorry for the delay. Is a Tag Pipeline a GitLab specific thing (this?) No, GitHub for example has something similar: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#running-your-w[…]fic-tags-occurs , though most might use the 'Release' Pipeline Trigger instead (which doesn't exist in GitLab, I think). > I think you’re right, though. If you can’t get the branch, the simplest option might be to dual publish. You could potentially use tags in PactFlow/Broker, and then query the API to navigate to the related branch. That’s probably doable I currently don't seem to have a problem. Checking out Tags works perfectly fine in Git, i think Gitlab pipelines usually check out detached heads (commits without branches) anyway.