Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

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

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

Already on GitHub? Sign in to your account

[ISSUE]: including tag-prefix in GitVersion.yml causes DevOps CI to throw error #4466

Closed
2 tasks done
Cali007UK opened this issue Mar 20, 2025 · 0 comments
Closed
2 tasks done

Comments

@Cali007UK
Copy link

Prerequisites

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

GitVersion package

AzureDevops task

GitVersion version

6.0.5

Operating system

N/A

What are you seeing?

Running gitversion in an azure devops pipeline as such:

# Install and run GitVersion
- task: gitversion/setup@3.1.11
  displayName: 'Install GitVersion'
  inputs:
    versionSpec: '6.0.5'

- task: gitversion/execute@3.1.11
  displayName: 'Calculate Version'
  inputs:
    targetPath: '$(workingDirectory)'
    useConfigFile: true
    configFilePath: '$(workingDirectory)/GitVersion.yml'
    updateAssemblyInfo: true

and If I include the tag-prefix option in the GitVersion.yml the pipelines throws a:
GitVersion output is not valid JSON

What is expected?

I need to use the tag-prefix option as I'm trying to split versioning across a couple of projects in a mono-repo that I cannot split.

All guides I can find suggest this is the correct practice, but any combination of values I attempt to use with the option all fail with the same error.

As soon as it's removed it runs fine (but uses the same version number for both projects)

Steps to Reproduce

Azure pipeline as standard (and shown above)

plus GitVersion.yml:
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
version-in-branch-pattern: '(?\d+(.\d+)?(.\d+)?).'
major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w\s-,/\\]
\))?((!|:.\n\n((.+\n)+\n)?BREAKING CHANGE:|.BREAKING CHANGE))"
minor-version-bump-message: "^(feature|story|feat)(\([\w\s-,/\\]
\))?"
patch-version-bump-message: "^(fix|bug)(\([\w\s-,/\\]
\))?"
no-bump-message: '+semver:\s?(none|skip)'
#tag-prefix: 'ToDo/'
commit-date-format: yyyy-MM-dd
merge-message-formats: {}
update-build-number: true
semantic-version-format: Strict
strategies:

  • VersionInBranchName
  • MergeMessage
  • TaggedCommit

branches:
main:
mode: ContinuousDeployment
label: ''
increment: Patch
prevent-increment:
of-merged-branch: true
when-branch-merged: true
when-current-commit-tagged: false
track-merge-target: false
track-merge-message: false
regex: ^master$|^main$
source-branches: []
is-source-branch-for: []
tracks-release-branches: false
is-release-branch: false
is-main-branch: true
pre-release-weight: 55000

release:
mode: ContinuousDelivery
label: rc
increment: None
prevent-increment:
of-merged-branch: false
when-branch-merged: false
when-current-commit-tagged: false
track-merge-target: false
track-merge-message: false
regex: ^release[/-]
source-branches:
- main
is-source-branch-for: []
tracks-release-branches: false
is-release-branch: true
is-main-branch: false
pre-release-weight: 30000
commit-message-incrementing: Disabled

feature:
mode: ContinuousDelivery
label: alpha
increment: Minor
prevent-increment:
when-current-commit-tagged: false
track-merge-message: false
regex: ^feature[/-]
source-branches:
- main
- release
is-source-branch-for: []
is-main-branch: false
pre-release-weight: 30000

story:
mode: ContinuousDelivery
label: alpha
increment: Minor
prevent-increment:
when-current-commit-tagged: false
track-merge-message: false
regex: ^story[/-]
source-branches:
- main
- release
is-source-branch-for: []
is-main-branch: false
pre-release-weight: 30000

hotfix:
mode: ContinuousDelivery
label: alpha
increment: Inherit
prevent-increment:
when-current-commit-tagged: false
track-merge-message: false
regex: ^hotfix[/-]
source-branches:
- release
is-source-branch-for: []
is-main-branch: false
pre-release-weight: 30000

bug:
mode: ContinuousDelivery
label: alpha
increment: Patch
prevent-increment:
when-current-commit-tagged: false
track-merge-message: false
regex: ^bug[/-]
source-branches:
- main
- release
is-source-branch-for: []
is-main-branch: false
pre-release-weight: 30000

fix:
mode: ContinuousDelivery
label: alpha
increment: Patch
prevent-increment:
when-current-commit-tagged: false
track-merge-message: false
regex: ^fix[/-]
source-branches:
- main
- release
is-source-branch-for: []
is-main-branch: false
pre-release-weight: 30000

unknown:
mode: ContinuousDeployment
label: alpha
increment: Inherit
prevent-increment:
when-current-commit-tagged: false
track-merge-message: false
regex: (?.+)
source-branches:
- main
- release
- feature
- pull-request
is-source-branch-for: []
is-main-branch: false

ignore:
sha: []

mode: ContinuousDelivery
increment: Inherit
prevent-increment:
of-merged-branch: false
when-branch-merged: false
when-current-commit-tagged: false
track-merge-target: false
track-merge-message: true

RepositoryFixture Test

No response

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

@GitTools GitTools locked and limited conversation to collaborators Mar 20, 2025
@HHobeck HHobeck converted this issue into discussion #4467 Mar 20, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

1 participant