Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[ISSUE]: GitLab CI tag pipelines result in an incorrect version #4186

Closed
2 tasks done
AlphaYankee opened this issue Aug 29, 2024 · 2 comments
Closed
2 tasks done

[ISSUE]: GitLab CI tag pipelines result in an incorrect version #4186

AlphaYankee opened this issue Aug 29, 2024 · 2 comments

Comments

@AlphaYankee
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.Tool

GitVersion version

6.0.2

Operating system

Linux

What are you seeing?

When running a tag pipeline, the tag is incorrectly detected as a branch. GitVersion gets its branch name from the environment variable CI_COMMIT_REF_NAME, but this variable is set to the tag when it's running a tag pipeline.

Example:

  • Tag a commit as v1.1.2
  • This executes a tag pipeline in GitLab CI
  • The resulting SemVer will be 1.1.3-v1-1-2.1

What is expected?

A SemVer of 1.1.2 (in this example)

Steps to Reproduce

See example in the issue description.
More details in the discussion #4183

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

No response

@asbjornu
Copy link
Member

Duplicate of #4015.

@asbjornu asbjornu closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2024
@AlphaYankee
Copy link
Contributor Author

The two issues are basically the same, yes. But this issue is about the incorrect usage of a GitLab CI specific environment variable, the other issue is about Azure Pipelines.

It might be better if there's a universal fix, as you said. But I believe this is a quick fix and it mirrors the fix for GitHub Actions which seems to have had a very similar problem, so it might still be a good idea to apply it for now.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants