diff --git a/.github/actions/cache-restore/action.yml b/.github/actions/cache-restore/action.yml
index 153f2d15f0..ae5e9f409e 100644
--- a/.github/actions/cache-restore/action.yml
+++ b/.github/actions/cache-restore/action.yml
@@ -16,7 +16,7 @@ runs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: tools
- key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
+ key: tools-${{ runner.os }}-${{ hashFiles('./build/**', './.gitversion.yml') }}
- name: Cache NuGet packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
diff --git a/.github/workflows/_prepare.yml b/.github/workflows/_prepare.yml
index 0f4235a14e..22b5266e82 100644
--- a/.github/workflows/_prepare.yml
+++ b/.github/workflows/_prepare.yml
@@ -42,7 +42,7 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: tools
- key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
+ key: tools-${{ runner.os }}-${{ hashFiles('./build/**', './.gitversion.yml') }}
- name: Cache NuGet packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 702f71a026..ee82f2a4cb 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -64,7 +64,7 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: tools
- key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }}
+ key: tools-${{ runner.os }}-${{ hashFiles('./build/**', './.gitversion.yml') }}
- name: Setup .NET SDK
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
diff --git a/.gitversion.yml b/.gitversion.yml
index 7f3e82a62b..7cadf9dc16 100644
--- a/.gitversion.yml
+++ b/.gitversion.yml
@@ -1,9 +1,11 @@
# $schema: https://gitversion.net/schemas/7.0/GitVersion.configuration.json
workflow: GitFlow/v1
-mode: ManualDeployment
-next-version: 7.0.0
-branches:
- main:
- label: alpha
- support:
- label: beta
+calculation:
+ mode: ManualDeployment
+ next-version: 7.0.0
+ branches:
+ main:
+ label: alpha
+ support:
+ label: beta
+output: {}
diff --git a/docs/input/docs/reference/configuration.md b/docs/input/docs/reference/configuration.md
index 0015f1e1b6..7265143f16 100644
--- a/docs/input/docs/reference/configuration.md
+++ b/docs/input/docs/reference/configuration.md
@@ -33,7 +33,8 @@ Example of using a `GitHubFlow` workflow with a different `tag-prefix`:
```yaml
workflow: GitHubFlow/v1
-tag-prefix: '[abc]'
+calculation:
+ tag-prefix: '[abc]'
```
The built-in configuration for the `GitFlow` workflow (`workflow: GitFlow/v1`) looks like:
@@ -41,178 +42,188 @@ The built-in configuration for the `GitFlow` workflow (`workflow: GitFlow/v1`) l
```yml
-assembly-file-versioning-scheme: MajorMinorPatch
-assembly-versioning-scheme: MajorMinorPatch
-branches:
- develop:
- increment: Minor
- is-main-branch: false
- is-release-branch: false
- is-source-branch-for: []
- label: alpha
- mode: ContinuousDelivery
- pre-release-weight: 0
- prevent-increment:
- when-current-commit-tagged: false
- regex: ^dev(elop)?(ment)?$
- source-branches:
- - main
- track-merge-message: true
- track-merge-target: true
- tracks-release-branches: true
- main:
- increment: Patch
- is-main-branch: true
- is-release-branch: false
- is-source-branch-for: []
- label: ''
- pre-release-weight: 55000
- prevent-increment:
- of-merged-branch: true
- regex: "^master$|^main$"
- source-branches: []
- track-merge-message: true
- track-merge-target: false
- tracks-release-branches: false
- release:
- increment: Minor
- is-main-branch: false
- is-release-branch: true
- is-source-branch-for: []
- label: beta
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-current-commit-tagged: false
- regex: "^releases?[\\/-](?.+)"
- source-branches:
- - main
- - support
- track-merge-target: false
- tracks-release-branches: false
- feature:
- increment: Inherit
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^features?[\\/-](?.+)"
- source-branches:
- - develop
- - main
- - release
- - support
- - hotfix
- track-merge-message: true
- pull-request:
- increment: Inherit
- is-source-branch-for: []
- label: "PullRequest{Number}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-current-commit-tagged: false
- regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
- source-branches:
- - develop
- - main
- - release
- - feature
- - support
- - hotfix
- track-merge-message: true
- hotfix:
- increment: Inherit
- is-main-branch: false
- is-release-branch: true
- is-source-branch-for: []
- label: beta
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^hotfix(es)?[\\/-](?.+)"
- source-branches:
- - main
- - support
- support:
- increment: Patch
- is-main-branch: true
- is-release-branch: false
- is-source-branch-for: []
- label: ''
- pre-release-weight: 55000
- prevent-increment:
- of-merged-branch: true
- regex: "^support[\\/-](?.+)"
- source-branches:
- - main
- track-merge-target: false
- tracks-release-branches: false
- unknown:
- increment: Inherit
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ManualDeployment
- prevent-increment:
- when-current-commit-tagged: true
- regex: "(?.+)"
- source-branches:
- - main
- - develop
- - release
- - feature
- - pull-request
- - hotfix
- - support
-commit-date-format: yyyy-MM-dd
-commit-message-incrementing: Enabled
-ignore:
- branches: []
- paths: []
- sha: []
- tags: []
-increment: Inherit
-is-main-branch: false
-is-release-branch: false
-is-source-branch-for: []
-label: "{BranchName}"
-major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
-merge-message-formats: {}
-minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
-mode: ContinuousDelivery
-no-bump-message: "[+=]semver:\\s?(none|skip)"
-patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
-prevent-increment:
- of-merged-branch: false
- when-branch-merged: false
- when-current-commit-tagged: true
-regex: ''
-semantic-version-format: Strict
-source-branches: []
-strategies:
- - Fallback
- - ConfiguredNextVersion
- - MergeMessage
- - TaggedCommit
- - TrackReleaseBranches
- - VersionInBranchName
-tag-pre-release-weight: 60000
-tag-prefix: "[vV]?"
-track-merge-message: true
-track-merge-target: false
-tracks-release-branches: false
-update-build-number: true
-version-bump-reset-message: "=semver:"
-version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+calculation:
+ branches:
+ develop:
+ increment: Minor
+ is-main-branch: false
+ is-release-branch: false
+ is-source-branch-for: []
+ label: alpha
+ mode: ContinuousDelivery
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: ^dev(elop)?(ment)?$
+ source-branches:
+ - main
+ track-merge-message: true
+ track-merge-target: true
+ tracks-release-branches: true
+ main:
+ increment: Patch
+ is-main-branch: true
+ is-release-branch: false
+ is-source-branch-for: []
+ label: ''
+ prevent-increment:
+ of-merged-branch: true
+ regex: "^master$|^main$"
+ source-branches: []
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ release:
+ increment: Minor
+ is-main-branch: false
+ is-release-branch: true
+ is-source-branch-for: []
+ label: beta
+ mode: ManualDeployment
+ prevent-increment:
+ of-merged-branch: true
+ when-current-commit-tagged: false
+ regex: "^releases?[\\/-](?.+)"
+ source-branches:
+ - main
+ - support
+ track-merge-target: false
+ tracks-release-branches: false
+ feature:
+ increment: Inherit
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^features?[\\/-](?.+)"
+ source-branches:
+ - develop
+ - main
+ - release
+ - support
+ - hotfix
+ track-merge-message: true
+ pull-request:
+ increment: Inherit
+ is-source-branch-for: []
+ label: "PullRequest{Number}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ of-merged-branch: true
+ when-current-commit-tagged: false
+ regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
+ source-branches:
+ - develop
+ - main
+ - release
+ - feature
+ - support
+ - hotfix
+ track-merge-message: true
+ hotfix:
+ increment: Inherit
+ is-main-branch: false
+ is-release-branch: true
+ is-source-branch-for: []
+ label: beta
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^hotfix(es)?[\\/-](?.+)"
+ source-branches:
+ - main
+ - support
+ support:
+ increment: Patch
+ is-main-branch: true
+ is-release-branch: false
+ is-source-branch-for: []
+ label: ''
+ prevent-increment:
+ of-merged-branch: true
+ regex: "^support[\\/-](?.+)"
+ source-branches:
+ - main
+ track-merge-target: false
+ tracks-release-branches: false
+ unknown:
+ increment: Inherit
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: true
+ regex: "(?.+)"
+ source-branches:
+ - main
+ - develop
+ - release
+ - feature
+ - pull-request
+ - hotfix
+ - support
+ commit-message-incrementing: Enabled
+ ignore:
+ branches: []
+ paths: []
+ sha: []
+ tags: []
+ increment: Inherit
+ is-main-branch: false
+ is-release-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
+ merge-message-formats: {}
+ minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
+ mode: ContinuousDelivery
+ no-bump-message: "[+=]semver:\\s?(none|skip)"
+ patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
+ prevent-increment:
+ of-merged-branch: false
+ when-branch-merged: false
+ when-current-commit-tagged: true
+ regex: ''
+ semantic-version-format: Strict
+ source-branches: []
+ strategies:
+ - Fallback
+ - ConfiguredNextVersion
+ - MergeMessage
+ - TaggedCommit
+ - TrackReleaseBranches
+ - VersionInBranchName
+ tag-prefix: "[vV]?"
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ version-bump-reset-message: "=semver:"
+ version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+output:
+ assembly-file-versioning-scheme: MajorMinorPatch
+ assembly-versioning-scheme: MajorMinorPatch
+ branches:
+ develop:
+ pre-release-weight: 0
+ main:
+ pre-release-weight: 55000
+ release:
+ pre-release-weight: 30000
+ feature:
+ pre-release-weight: 30000
+ pull-request:
+ pre-release-weight: 30000
+ hotfix:
+ pre-release-weight: 30000
+ support:
+ pre-release-weight: 55000
+ commit-date-format: yyyy-MM-dd
+ tag-pre-release-weight: 60000
+ update-build-number: true
```
-snippet source | anchor
+snippet source | anchor
The supported built-in configuration for the `GitHubFlow` workflow (`workflow: GitHubFlow/v1`) looks like:
@@ -220,127 +231,134 @@ The supported built-in configuration for the `GitHubFlow` workflow (`workflow: G
```yml
-assembly-file-versioning-scheme: MajorMinorPatch
-assembly-versioning-scheme: MajorMinorPatch
-branches:
- main:
- increment: Patch
- is-main-branch: true
- is-release-branch: false
- is-source-branch-for: []
- label: ''
- pre-release-weight: 55000
- prevent-increment:
- of-merged-branch: true
- regex: "^master$|^main$"
- source-branches: []
- track-merge-message: true
- track-merge-target: false
- tracks-release-branches: false
- release:
- increment: Patch
- is-main-branch: false
- is-release-branch: true
- is-source-branch-for: []
- label: beta
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-branch-merged: false
- when-current-commit-tagged: false
- regex: "^releases?[\\/-](?.+)"
- source-branches:
- - main
- track-merge-message: true
- track-merge-target: false
- tracks-release-branches: false
- feature:
- increment: Inherit
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^features?[\\/-](?.+)"
- source-branches:
- - main
- - release
- track-merge-message: true
- pull-request:
- increment: Inherit
- is-source-branch-for: []
- label: "PullRequest{Number}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-current-commit-tagged: false
- regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
- source-branches:
- - main
- - release
- - feature
- track-merge-message: true
- unknown:
- increment: Inherit
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ManualDeployment
- prevent-increment:
- when-current-commit-tagged: false
- regex: "(?.+)"
- source-branches:
- - main
- - release
- - feature
- - pull-request
- track-merge-message: false
-commit-date-format: yyyy-MM-dd
-commit-message-incrementing: Enabled
-ignore:
- branches: []
- paths: []
- sha: []
- tags: []
-increment: Inherit
-is-main-branch: false
-is-release-branch: false
-is-source-branch-for: []
-label: "{BranchName}"
-major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
-merge-message-formats: {}
-minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
-mode: ContinuousDelivery
-no-bump-message: "[+=]semver:\\s?(none|skip)"
-patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
-prevent-increment:
- of-merged-branch: false
- when-branch-merged: false
- when-current-commit-tagged: true
-regex: ''
-semantic-version-format: Strict
-source-branches: []
-strategies:
- - Fallback
- - ConfiguredNextVersion
- - MergeMessage
- - TaggedCommit
- - TrackReleaseBranches
- - VersionInBranchName
-tag-pre-release-weight: 60000
-tag-prefix: "[vV]?"
-track-merge-message: true
-track-merge-target: false
-tracks-release-branches: false
-update-build-number: true
-version-bump-reset-message: "=semver:"
-version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+calculation:
+ branches:
+ main:
+ increment: Patch
+ is-main-branch: true
+ is-release-branch: false
+ is-source-branch-for: []
+ label: ''
+ prevent-increment:
+ of-merged-branch: true
+ regex: "^master$|^main$"
+ source-branches: []
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ release:
+ increment: Patch
+ is-main-branch: false
+ is-release-branch: true
+ is-source-branch-for: []
+ label: beta
+ mode: ManualDeployment
+ prevent-increment:
+ of-merged-branch: true
+ when-branch-merged: false
+ when-current-commit-tagged: false
+ regex: "^releases?[\\/-](?.+)"
+ source-branches:
+ - main
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ feature:
+ increment: Inherit
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^features?[\\/-](?.+)"
+ source-branches:
+ - main
+ - release
+ track-merge-message: true
+ pull-request:
+ increment: Inherit
+ is-source-branch-for: []
+ label: "PullRequest{Number}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ of-merged-branch: true
+ when-current-commit-tagged: false
+ regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
+ source-branches:
+ - main
+ - release
+ - feature
+ track-merge-message: true
+ unknown:
+ increment: Inherit
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "(?.+)"
+ source-branches:
+ - main
+ - release
+ - feature
+ - pull-request
+ track-merge-message: false
+ commit-message-incrementing: Enabled
+ ignore:
+ branches: []
+ paths: []
+ sha: []
+ tags: []
+ increment: Inherit
+ is-main-branch: false
+ is-release-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
+ merge-message-formats: {}
+ minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
+ mode: ContinuousDelivery
+ no-bump-message: "[+=]semver:\\s?(none|skip)"
+ patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
+ prevent-increment:
+ of-merged-branch: false
+ when-branch-merged: false
+ when-current-commit-tagged: true
+ regex: ''
+ semantic-version-format: Strict
+ source-branches: []
+ strategies:
+ - Fallback
+ - ConfiguredNextVersion
+ - MergeMessage
+ - TaggedCommit
+ - TrackReleaseBranches
+ - VersionInBranchName
+ tag-prefix: "[vV]?"
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ version-bump-reset-message: "=semver:"
+ version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+output:
+ assembly-file-versioning-scheme: MajorMinorPatch
+ assembly-versioning-scheme: MajorMinorPatch
+ branches:
+ main:
+ pre-release-weight: 55000
+ release:
+ pre-release-weight: 30000
+ feature:
+ pre-release-weight: 30000
+ pull-request:
+ pre-release-weight: 30000
+ commit-date-format: yyyy-MM-dd
+ tag-pre-release-weight: 60000
+ update-build-number: true
```
-snippet source | anchor
+snippet source | anchor
The preview built-in configuration (experimental usage only) for the `TrunkBased` workflow (`workflow: TrunkBased/preview1`) looks like:
@@ -348,112 +366,120 @@ The preview built-in configuration (experimental usage only) for the `TrunkBased
```yml
-assembly-file-versioning-scheme: MajorMinorPatch
-assembly-versioning-scheme: MajorMinorPatch
-branches:
- main:
- increment: Patch
- is-main-branch: true
- is-release-branch: false
- is-source-branch-for: []
- label: ''
- mode: ContinuousDeployment
- pre-release-weight: 55000
- prevent-increment:
- of-merged-branch: true
- regex: "^master$|^main$"
- source-branches: []
- track-merge-message: true
- track-merge-target: false
- tracks-release-branches: false
- feature:
- increment: Minor
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^features?[\\/-](?.+)"
- source-branches:
- - main
- track-merge-message: true
- hotfix:
- increment: Patch
- is-main-branch: false
- is-release-branch: true
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^hotfix(es)?[\\/-](?.+)"
- source-branches:
- - main
- pull-request:
- increment: Inherit
- is-source-branch-for: []
- label: "PullRequest{Number}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-current-commit-tagged: false
- regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
- source-branches:
- - main
- - feature
- - hotfix
- track-merge-message: true
- unknown:
- increment: Patch
- is-source-branch-for: []
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "(?.+)"
- source-branches:
- - main
-commit-date-format: yyyy-MM-dd
-commit-message-incrementing: Enabled
-ignore:
- branches: []
- paths: []
- sha: []
- tags: []
-increment: Inherit
-is-main-branch: false
-is-release-branch: false
-is-source-branch-for: []
-label: "{BranchName}"
-major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
-merge-message-formats: {}
-minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
-mode: ContinuousDelivery
-no-bump-message: "[+=]semver:\\s?(none|skip)"
-patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
-prevent-increment:
- of-merged-branch: false
- when-branch-merged: false
- when-current-commit-tagged: true
-regex: ''
-semantic-version-format: Strict
-source-branches: []
-strategies:
- - ConfiguredNextVersion
- - Mainline
-tag-pre-release-weight: 60000
-tag-prefix: "[vV]?"
-track-merge-message: true
-track-merge-target: false
-tracks-release-branches: false
-update-build-number: true
-version-bump-reset-message: "=semver:"
-version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+calculation:
+ branches:
+ main:
+ increment: Patch
+ is-main-branch: true
+ is-release-branch: false
+ is-source-branch-for: []
+ label: ''
+ mode: ContinuousDeployment
+ prevent-increment:
+ of-merged-branch: true
+ regex: "^master$|^main$"
+ source-branches: []
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ feature:
+ increment: Minor
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^features?[\\/-](?.+)"
+ source-branches:
+ - main
+ track-merge-message: true
+ hotfix:
+ increment: Patch
+ is-main-branch: false
+ is-release-branch: true
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^hotfix(es)?[\\/-](?.+)"
+ source-branches:
+ - main
+ pull-request:
+ increment: Inherit
+ is-source-branch-for: []
+ label: "PullRequest{Number}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ of-merged-branch: true
+ when-current-commit-tagged: false
+ regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
+ source-branches:
+ - main
+ - feature
+ - hotfix
+ track-merge-message: true
+ unknown:
+ increment: Patch
+ is-source-branch-for: []
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "(?.+)"
+ source-branches:
+ - main
+ commit-message-incrementing: Enabled
+ ignore:
+ branches: []
+ paths: []
+ sha: []
+ tags: []
+ increment: Inherit
+ is-main-branch: false
+ is-release-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
+ merge-message-formats: {}
+ minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
+ mode: ContinuousDelivery
+ no-bump-message: "[+=]semver:\\s?(none|skip)"
+ patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
+ prevent-increment:
+ of-merged-branch: false
+ when-branch-merged: false
+ when-current-commit-tagged: true
+ regex: ''
+ semantic-version-format: Strict
+ source-branches: []
+ strategies:
+ - ConfiguredNextVersion
+ - Mainline
+ tag-prefix: "[vV]?"
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ version-bump-reset-message: "=semver:"
+ version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+output:
+ assembly-file-versioning-scheme: MajorMinorPatch
+ assembly-versioning-scheme: MajorMinorPatch
+ branches:
+ main:
+ pre-release-weight: 55000
+ feature:
+ pre-release-weight: 30000
+ hotfix:
+ pre-release-weight: 30000
+ pull-request:
+ pre-release-weight: 30000
+ unknown:
+ pre-release-weight: 30000
+ commit-date-format: yyyy-MM-dd
+ tag-pre-release-weight: 60000
+ update-build-number: true
```
-snippet source | anchor
+snippet source | anchor
The details of the available options are as follows:
diff --git a/docs/input/docs/reference/mdsource/configuration.source.md b/docs/input/docs/reference/mdsource/configuration.source.md
index 42454a39f1..9fb8f0330d 100644
--- a/docs/input/docs/reference/mdsource/configuration.source.md
+++ b/docs/input/docs/reference/mdsource/configuration.source.md
@@ -33,7 +33,8 @@ Example of using a `GitHubFlow` workflow with a different `tag-prefix`:
```yaml
workflow: GitHubFlow/v1
-tag-prefix: '[abc]'
+calculation:
+ tag-prefix: '[abc]'
```
The built-in configuration for the `GitFlow` workflow (`workflow: GitFlow/v1`) looks like:
diff --git a/docs/input/docs/workflows/GitFlow/v1.yml b/docs/input/docs/workflows/GitFlow/v1.yml
index cb02dab624..eb3ec5ba8a 100644
--- a/docs/input/docs/workflows/GitFlow/v1.yml
+++ b/docs/input/docs/workflows/GitFlow/v1.yml
@@ -1,170 +1,180 @@
-assembly-file-versioning-scheme: MajorMinorPatch
-assembly-versioning-scheme: MajorMinorPatch
-branches:
- develop:
- increment: Minor
- is-main-branch: false
- is-release-branch: false
- is-source-branch-for: []
- label: alpha
- mode: ContinuousDelivery
- pre-release-weight: 0
- prevent-increment:
- when-current-commit-tagged: false
- regex: ^dev(elop)?(ment)?$
- source-branches:
- - main
- track-merge-message: true
- track-merge-target: true
- tracks-release-branches: true
- main:
- increment: Patch
- is-main-branch: true
- is-release-branch: false
- is-source-branch-for: []
- label: ''
- pre-release-weight: 55000
- prevent-increment:
- of-merged-branch: true
- regex: "^master$|^main$"
- source-branches: []
- track-merge-message: true
- track-merge-target: false
- tracks-release-branches: false
- release:
- increment: Minor
- is-main-branch: false
- is-release-branch: true
- is-source-branch-for: []
- label: beta
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-current-commit-tagged: false
- regex: "^releases?[\\/-](?.+)"
- source-branches:
- - main
- - support
- track-merge-target: false
- tracks-release-branches: false
- feature:
- increment: Inherit
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^features?[\\/-](?.+)"
- source-branches:
- - develop
- - main
- - release
- - support
- - hotfix
- track-merge-message: true
- pull-request:
- increment: Inherit
- is-source-branch-for: []
- label: "PullRequest{Number}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-current-commit-tagged: false
- regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
- source-branches:
- - develop
- - main
- - release
- - feature
- - support
- - hotfix
- track-merge-message: true
- hotfix:
- increment: Inherit
- is-main-branch: false
- is-release-branch: true
- is-source-branch-for: []
- label: beta
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^hotfix(es)?[\\/-](?.+)"
- source-branches:
- - main
- - support
- support:
- increment: Patch
- is-main-branch: true
- is-release-branch: false
- is-source-branch-for: []
- label: ''
- pre-release-weight: 55000
- prevent-increment:
- of-merged-branch: true
- regex: "^support[\\/-](?.+)"
- source-branches:
- - main
- track-merge-target: false
- tracks-release-branches: false
- unknown:
- increment: Inherit
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ManualDeployment
- prevent-increment:
- when-current-commit-tagged: true
- regex: "(?.+)"
- source-branches:
- - main
- - develop
- - release
- - feature
- - pull-request
- - hotfix
- - support
-commit-date-format: yyyy-MM-dd
-commit-message-incrementing: Enabled
-ignore:
- branches: []
- paths: []
- sha: []
- tags: []
-increment: Inherit
-is-main-branch: false
-is-release-branch: false
-is-source-branch-for: []
-label: "{BranchName}"
-major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
-merge-message-formats: {}
-minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
-mode: ContinuousDelivery
-no-bump-message: "[+=]semver:\\s?(none|skip)"
-patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
-prevent-increment:
- of-merged-branch: false
- when-branch-merged: false
- when-current-commit-tagged: true
-regex: ''
-semantic-version-format: Strict
-source-branches: []
-strategies:
- - Fallback
- - ConfiguredNextVersion
- - MergeMessage
- - TaggedCommit
- - TrackReleaseBranches
- - VersionInBranchName
-tag-pre-release-weight: 60000
-tag-prefix: "[vV]?"
-track-merge-message: true
-track-merge-target: false
-tracks-release-branches: false
-update-build-number: true
-version-bump-reset-message: "=semver:"
-version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+calculation:
+ branches:
+ develop:
+ increment: Minor
+ is-main-branch: false
+ is-release-branch: false
+ is-source-branch-for: []
+ label: alpha
+ mode: ContinuousDelivery
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: ^dev(elop)?(ment)?$
+ source-branches:
+ - main
+ track-merge-message: true
+ track-merge-target: true
+ tracks-release-branches: true
+ main:
+ increment: Patch
+ is-main-branch: true
+ is-release-branch: false
+ is-source-branch-for: []
+ label: ''
+ prevent-increment:
+ of-merged-branch: true
+ regex: "^master$|^main$"
+ source-branches: []
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ release:
+ increment: Minor
+ is-main-branch: false
+ is-release-branch: true
+ is-source-branch-for: []
+ label: beta
+ mode: ManualDeployment
+ prevent-increment:
+ of-merged-branch: true
+ when-current-commit-tagged: false
+ regex: "^releases?[\\/-](?.+)"
+ source-branches:
+ - main
+ - support
+ track-merge-target: false
+ tracks-release-branches: false
+ feature:
+ increment: Inherit
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^features?[\\/-](?.+)"
+ source-branches:
+ - develop
+ - main
+ - release
+ - support
+ - hotfix
+ track-merge-message: true
+ pull-request:
+ increment: Inherit
+ is-source-branch-for: []
+ label: "PullRequest{Number}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ of-merged-branch: true
+ when-current-commit-tagged: false
+ regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
+ source-branches:
+ - develop
+ - main
+ - release
+ - feature
+ - support
+ - hotfix
+ track-merge-message: true
+ hotfix:
+ increment: Inherit
+ is-main-branch: false
+ is-release-branch: true
+ is-source-branch-for: []
+ label: beta
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^hotfix(es)?[\\/-](?.+)"
+ source-branches:
+ - main
+ - support
+ support:
+ increment: Patch
+ is-main-branch: true
+ is-release-branch: false
+ is-source-branch-for: []
+ label: ''
+ prevent-increment:
+ of-merged-branch: true
+ regex: "^support[\\/-](?.+)"
+ source-branches:
+ - main
+ track-merge-target: false
+ tracks-release-branches: false
+ unknown:
+ increment: Inherit
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: true
+ regex: "(?.+)"
+ source-branches:
+ - main
+ - develop
+ - release
+ - feature
+ - pull-request
+ - hotfix
+ - support
+ commit-message-incrementing: Enabled
+ ignore:
+ branches: []
+ paths: []
+ sha: []
+ tags: []
+ increment: Inherit
+ is-main-branch: false
+ is-release-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
+ merge-message-formats: {}
+ minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
+ mode: ContinuousDelivery
+ no-bump-message: "[+=]semver:\\s?(none|skip)"
+ patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
+ prevent-increment:
+ of-merged-branch: false
+ when-branch-merged: false
+ when-current-commit-tagged: true
+ regex: ''
+ semantic-version-format: Strict
+ source-branches: []
+ strategies:
+ - Fallback
+ - ConfiguredNextVersion
+ - MergeMessage
+ - TaggedCommit
+ - TrackReleaseBranches
+ - VersionInBranchName
+ tag-prefix: "[vV]?"
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ version-bump-reset-message: "=semver:"
+ version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+output:
+ assembly-file-versioning-scheme: MajorMinorPatch
+ assembly-versioning-scheme: MajorMinorPatch
+ branches:
+ develop:
+ pre-release-weight: 0
+ main:
+ pre-release-weight: 55000
+ release:
+ pre-release-weight: 30000
+ feature:
+ pre-release-weight: 30000
+ pull-request:
+ pre-release-weight: 30000
+ hotfix:
+ pre-release-weight: 30000
+ support:
+ pre-release-weight: 55000
+ commit-date-format: yyyy-MM-dd
+ tag-pre-release-weight: 60000
+ update-build-number: true
diff --git a/docs/input/docs/workflows/GitHubFlow/v1.yml b/docs/input/docs/workflows/GitHubFlow/v1.yml
index 70e3a4d8bf..0e1d664674 100644
--- a/docs/input/docs/workflows/GitHubFlow/v1.yml
+++ b/docs/input/docs/workflows/GitHubFlow/v1.yml
@@ -1,119 +1,126 @@
-assembly-file-versioning-scheme: MajorMinorPatch
-assembly-versioning-scheme: MajorMinorPatch
-branches:
- main:
- increment: Patch
- is-main-branch: true
- is-release-branch: false
- is-source-branch-for: []
- label: ''
- pre-release-weight: 55000
- prevent-increment:
- of-merged-branch: true
- regex: "^master$|^main$"
- source-branches: []
- track-merge-message: true
- track-merge-target: false
- tracks-release-branches: false
- release:
- increment: Patch
- is-main-branch: false
- is-release-branch: true
- is-source-branch-for: []
- label: beta
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-branch-merged: false
- when-current-commit-tagged: false
- regex: "^releases?[\\/-](?.+)"
- source-branches:
- - main
- track-merge-message: true
- track-merge-target: false
- tracks-release-branches: false
- feature:
- increment: Inherit
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ManualDeployment
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^features?[\\/-](?.+)"
- source-branches:
- - main
- - release
- track-merge-message: true
- pull-request:
- increment: Inherit
- is-source-branch-for: []
- label: "PullRequest{Number}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-current-commit-tagged: false
- regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
- source-branches:
- - main
- - release
- - feature
- track-merge-message: true
- unknown:
- increment: Inherit
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ManualDeployment
- prevent-increment:
- when-current-commit-tagged: false
- regex: "(?.+)"
- source-branches:
- - main
- - release
- - feature
- - pull-request
- track-merge-message: false
-commit-date-format: yyyy-MM-dd
-commit-message-incrementing: Enabled
-ignore:
- branches: []
- paths: []
- sha: []
- tags: []
-increment: Inherit
-is-main-branch: false
-is-release-branch: false
-is-source-branch-for: []
-label: "{BranchName}"
-major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
-merge-message-formats: {}
-minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
-mode: ContinuousDelivery
-no-bump-message: "[+=]semver:\\s?(none|skip)"
-patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
-prevent-increment:
- of-merged-branch: false
- when-branch-merged: false
- when-current-commit-tagged: true
-regex: ''
-semantic-version-format: Strict
-source-branches: []
-strategies:
- - Fallback
- - ConfiguredNextVersion
- - MergeMessage
- - TaggedCommit
- - TrackReleaseBranches
- - VersionInBranchName
-tag-pre-release-weight: 60000
-tag-prefix: "[vV]?"
-track-merge-message: true
-track-merge-target: false
-tracks-release-branches: false
-update-build-number: true
-version-bump-reset-message: "=semver:"
-version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+calculation:
+ branches:
+ main:
+ increment: Patch
+ is-main-branch: true
+ is-release-branch: false
+ is-source-branch-for: []
+ label: ''
+ prevent-increment:
+ of-merged-branch: true
+ regex: "^master$|^main$"
+ source-branches: []
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ release:
+ increment: Patch
+ is-main-branch: false
+ is-release-branch: true
+ is-source-branch-for: []
+ label: beta
+ mode: ManualDeployment
+ prevent-increment:
+ of-merged-branch: true
+ when-branch-merged: false
+ when-current-commit-tagged: false
+ regex: "^releases?[\\/-](?.+)"
+ source-branches:
+ - main
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ feature:
+ increment: Inherit
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^features?[\\/-](?.+)"
+ source-branches:
+ - main
+ - release
+ track-merge-message: true
+ pull-request:
+ increment: Inherit
+ is-source-branch-for: []
+ label: "PullRequest{Number}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ of-merged-branch: true
+ when-current-commit-tagged: false
+ regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
+ source-branches:
+ - main
+ - release
+ - feature
+ track-merge-message: true
+ unknown:
+ increment: Inherit
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ManualDeployment
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "(?.+)"
+ source-branches:
+ - main
+ - release
+ - feature
+ - pull-request
+ track-merge-message: false
+ commit-message-incrementing: Enabled
+ ignore:
+ branches: []
+ paths: []
+ sha: []
+ tags: []
+ increment: Inherit
+ is-main-branch: false
+ is-release-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
+ merge-message-formats: {}
+ minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
+ mode: ContinuousDelivery
+ no-bump-message: "[+=]semver:\\s?(none|skip)"
+ patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
+ prevent-increment:
+ of-merged-branch: false
+ when-branch-merged: false
+ when-current-commit-tagged: true
+ regex: ''
+ semantic-version-format: Strict
+ source-branches: []
+ strategies:
+ - Fallback
+ - ConfiguredNextVersion
+ - MergeMessage
+ - TaggedCommit
+ - TrackReleaseBranches
+ - VersionInBranchName
+ tag-prefix: "[vV]?"
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ version-bump-reset-message: "=semver:"
+ version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+output:
+ assembly-file-versioning-scheme: MajorMinorPatch
+ assembly-versioning-scheme: MajorMinorPatch
+ branches:
+ main:
+ pre-release-weight: 55000
+ release:
+ pre-release-weight: 30000
+ feature:
+ pre-release-weight: 30000
+ pull-request:
+ pre-release-weight: 30000
+ commit-date-format: yyyy-MM-dd
+ tag-pre-release-weight: 60000
+ update-build-number: true
diff --git a/docs/input/docs/workflows/TrunkBased/preview1.yml b/docs/input/docs/workflows/TrunkBased/preview1.yml
index 2998ca1498..85b8f4d372 100644
--- a/docs/input/docs/workflows/TrunkBased/preview1.yml
+++ b/docs/input/docs/workflows/TrunkBased/preview1.yml
@@ -1,104 +1,112 @@
-assembly-file-versioning-scheme: MajorMinorPatch
-assembly-versioning-scheme: MajorMinorPatch
-branches:
- main:
- increment: Patch
- is-main-branch: true
- is-release-branch: false
- is-source-branch-for: []
- label: ''
- mode: ContinuousDeployment
- pre-release-weight: 55000
- prevent-increment:
- of-merged-branch: true
- regex: "^master$|^main$"
- source-branches: []
- track-merge-message: true
- track-merge-target: false
- tracks-release-branches: false
- feature:
- increment: Minor
- is-main-branch: false
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^features?[\\/-](?.+)"
- source-branches:
- - main
- track-merge-message: true
- hotfix:
- increment: Patch
- is-main-branch: false
- is-release-branch: true
- is-source-branch-for: []
- label: "{BranchName}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "^hotfix(es)?[\\/-](?.+)"
- source-branches:
- - main
- pull-request:
- increment: Inherit
- is-source-branch-for: []
- label: "PullRequest{Number}"
- mode: ContinuousDelivery
- pre-release-weight: 30000
- prevent-increment:
- of-merged-branch: true
- when-current-commit-tagged: false
- regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
- source-branches:
- - main
- - feature
- - hotfix
- track-merge-message: true
- unknown:
- increment: Patch
- is-source-branch-for: []
- pre-release-weight: 30000
- prevent-increment:
- when-current-commit-tagged: false
- regex: "(?.+)"
- source-branches:
- - main
-commit-date-format: yyyy-MM-dd
-commit-message-incrementing: Enabled
-ignore:
- branches: []
- paths: []
- sha: []
- tags: []
-increment: Inherit
-is-main-branch: false
-is-release-branch: false
-is-source-branch-for: []
-label: "{BranchName}"
-major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
-merge-message-formats: {}
-minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
-mode: ContinuousDelivery
-no-bump-message: "[+=]semver:\\s?(none|skip)"
-patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
-prevent-increment:
- of-merged-branch: false
- when-branch-merged: false
- when-current-commit-tagged: true
-regex: ''
-semantic-version-format: Strict
-source-branches: []
-strategies:
- - ConfiguredNextVersion
- - Mainline
-tag-pre-release-weight: 60000
-tag-prefix: "[vV]?"
-track-merge-message: true
-track-merge-target: false
-tracks-release-branches: false
-update-build-number: true
-version-bump-reset-message: "=semver:"
-version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+calculation:
+ branches:
+ main:
+ increment: Patch
+ is-main-branch: true
+ is-release-branch: false
+ is-source-branch-for: []
+ label: ''
+ mode: ContinuousDeployment
+ prevent-increment:
+ of-merged-branch: true
+ regex: "^master$|^main$"
+ source-branches: []
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ feature:
+ increment: Minor
+ is-main-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^features?[\\/-](?.+)"
+ source-branches:
+ - main
+ track-merge-message: true
+ hotfix:
+ increment: Patch
+ is-main-branch: false
+ is-release-branch: true
+ is-source-branch-for: []
+ label: "{BranchName}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "^hotfix(es)?[\\/-](?.+)"
+ source-branches:
+ - main
+ pull-request:
+ increment: Inherit
+ is-source-branch-for: []
+ label: "PullRequest{Number}"
+ mode: ContinuousDelivery
+ prevent-increment:
+ of-merged-branch: true
+ when-current-commit-tagged: false
+ regex: "^(pull-requests|pull|pr)[\\/-](?\\d*)"
+ source-branches:
+ - main
+ - feature
+ - hotfix
+ track-merge-message: true
+ unknown:
+ increment: Patch
+ is-source-branch-for: []
+ prevent-increment:
+ when-current-commit-tagged: false
+ regex: "(?.+)"
+ source-branches:
+ - main
+ commit-message-incrementing: Enabled
+ ignore:
+ branches: []
+ paths: []
+ sha: []
+ tags: []
+ increment: Inherit
+ is-main-branch: false
+ is-release-branch: false
+ is-source-branch-for: []
+ label: "{BranchName}"
+ major-version-bump-message: "[+=]semver:\\s?(breaking|major)"
+ merge-message-formats: {}
+ minor-version-bump-message: "[+=]semver:\\s?(feature|minor)"
+ mode: ContinuousDelivery
+ no-bump-message: "[+=]semver:\\s?(none|skip)"
+ patch-version-bump-message: "[+=]semver:\\s?(fix|patch)"
+ prevent-increment:
+ of-merged-branch: false
+ when-branch-merged: false
+ when-current-commit-tagged: true
+ regex: ''
+ semantic-version-format: Strict
+ source-branches: []
+ strategies:
+ - ConfiguredNextVersion
+ - Mainline
+ tag-prefix: "[vV]?"
+ track-merge-message: true
+ track-merge-target: false
+ tracks-release-branches: false
+ version-bump-reset-message: "=semver:"
+ version-in-branch-pattern: "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*"
+output:
+ assembly-file-versioning-scheme: MajorMinorPatch
+ assembly-versioning-scheme: MajorMinorPatch
+ branches:
+ main:
+ pre-release-weight: 55000
+ feature:
+ pre-release-weight: 30000
+ hotfix:
+ pre-release-weight: 30000
+ pull-request:
+ pre-release-weight: 30000
+ unknown:
+ pre-release-weight: 30000
+ commit-date-format: yyyy-MM-dd
+ tag-pre-release-weight: 60000
+ update-build-number: true
diff --git a/schemas/7.0/GitVersion.configuration.json b/schemas/7.0/GitVersion.configuration.json
index 4468d2f059..bda97e41bf 100644
--- a/schemas/7.0/GitVersion.configuration.json
+++ b/schemas/7.0/GitVersion.configuration.json
@@ -5,407 +5,432 @@
"description": "GitVersion configuration schema (7.0)",
"type": "object",
"properties": {
- "assembly-file-versioning-format": {
- "description": "Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.",
- "type": [
- "null",
- "string"
- ]
- },
- "assembly-file-versioning-scheme": {
- "description": "The scheme to use when setting AssemblyFileVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.",
- "default": "MajorMinorPatch",
- "enum": [
- "MajorMinorPatchTag",
- "MajorMinorPatch",
- "MajorMinor",
- "Major",
- "None",
- null
- ]
- },
- "assembly-informational-format": {
- "description": "Specifies the format of AssemblyInformationalVersion. Defaults to '{InformationalVersion}'.",
- "default": "'{InformationalVersion}'",
- "type": [
- "null",
- "string"
- ]
- },
- "assembly-versioning-format": {
- "description": "Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.",
- "type": [
- "null",
- "string"
- ]
- },
- "assembly-versioning-scheme": {
- "description": "The scheme to use when setting AssemblyVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.",
- "default": "MajorMinorPatch",
- "enum": [
- "MajorMinorPatchTag",
- "MajorMinorPatch",
- "MajorMinor",
- "Major",
- "None",
- null
- ]
- },
- "branches": {
- "description": "The header for all the individual branch configuration.",
+ "calculation": {
+ "description": "Settings that participate in semantic-version calculation.",
"type": "object",
- "additionalProperties": {
- "type": "object",
- "properties": {
- "commit-message-incrementing": {
- "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.",
- "enum": [
- "Enabled",
- "Disabled",
- "MergeMessageOnly",
- null
- ]
- },
- "custom-version-format": {
- "description": "Specifies the format of CustomVersion.",
- "type": [
- "null",
- "string"
- ]
- },
- "increment": {
- "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.",
- "$ref": "#/$defs/incrementStrategy"
- },
- "is-main-branch": {
- "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.",
- "type": [
- "null",
- "boolean"
- ]
- },
- "is-release-branch": {
- "description": "Indicates this branch configuration represents a release branch in GitFlow.",
- "type": [
- "null",
- "boolean"
- ]
- },
- "is-source-branch-for": {
- "description": "The branches that this branch is a source branch.",
- "$ref": "#/$defs/hashSetOfString"
- },
- "label": {
- "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).",
- "type": [
- "null",
- "string"
- ]
- },
- "mode": {
- "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.",
+ "properties": {
+ "branches": {
+ "description": "The header for all the individual branch configuration.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "object",
+ "properties": {
+ "commit-message-incrementing": {
+ "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.",
+ "enum": [
+ "Enabled",
+ "Disabled",
+ "MergeMessageOnly",
+ null
+ ]
+ },
+ "increment": {
+ "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.",
+ "$ref": "#/$defs/incrementStrategy"
+ },
+ "is-main-branch": {
+ "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ "is-release-branch": {
+ "description": "Indicates this branch configuration represents a release branch in GitFlow.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ "is-source-branch-for": {
+ "description": "The branches that this branch is a source branch.",
+ "$ref": "#/$defs/hashSetOfString"
+ },
+ "label": {
+ "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "mode": {
+ "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.",
+ "enum": [
+ "ManualDeployment",
+ "ContinuousDelivery",
+ "ContinuousDeployment",
+ null
+ ]
+ },
+ "prevent-increment": {
+ "description": "The prevent increment configuration section.",
+ "$ref": "#/$defs/preventIncrementConfiguration"
+ },
+ "regex": {
+ "format": "regex",
+ "description": "The regular expression pattern to use to match this branch. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "source-branches": {
+ "description": "The source branches for this branch.",
+ "$ref": "#/$defs/hashSetOfString"
+ },
+ "track-merge-message": {
+ "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ "track-merge-target": {
+ "description": "Strategy which will look for tagged merge commits directly off the current branch.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ "tracks-release-branches": {
+ "description": "Indicates this branch configuration represents develop in GitFlow.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "commit-message-incrementing": {
+ "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.",
+ "enum": [
+ "Enabled",
+ "Disabled",
+ "MergeMessageOnly",
+ null
+ ]
+ },
+ "ignore": {
+ "description": "The header property for the ignore configuration.",
+ "type": "object",
+ "properties": {
+ "branches": {
+ "description": "A sequence of regular expressions matching branch names without the remote prefix to be excluded as version sources. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "$ref": "#/$defs/hashSetOfString"
+ },
+ "commits-before": {
+ "format": "date-time",
+ "description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "paths": {
+ "description": "A sequence of regular expressions matching file paths to be excluded from the version calculations. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "$ref": "#/$defs/hashSetOfString"
+ },
+ "sha": {
+ "description": "A sequence of SHAs to be excluded from the version calculations.",
+ "$ref": "#/$defs/hashSetOfString"
+ },
+ "tags": {
+ "description": "A sequence of regular expressions matching friendly tag names to be excluded as version sources. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "$ref": "#/$defs/hashSetOfString"
+ }
+ }
+ },
+ "increment": {
+ "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.",
+ "$ref": "#/$defs/incrementStrategy"
+ },
+ "is-main-branch": {
+ "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ "is-release-branch": {
+ "description": "Indicates this branch configuration represents a release branch in GitFlow.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ "is-source-branch-for": {
+ "description": "The branches that this branch is a source branch.",
+ "$ref": "#/$defs/hashSetOfString"
+ },
+ "label": {
+ "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "major-version-bump-message": {
+ "format": "regex",
+ "description": "The regular expression to match commit messages with to perform a major version increment. Defaults to '[+=]semver:\\s?(breaking|major)'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "default": "[+=]semver:\\s?(breaking|major)",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "merge-message-formats": {
+ "description": "Custom regular expression merge message formats to enable identification of merge messages that do not follow the built-in conventions. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "minor-version-bump-message": {
+ "format": "regex",
+ "description": "The regular expression to match commit messages with to perform a minor version increment. Defaults to '[+=]semver:\\s?(feature|minor)'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "default": "[+=]semver:\\s?(feature|minor)",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "mode": {
+ "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.",
+ "enum": [
+ "ManualDeployment",
+ "ContinuousDelivery",
+ "ContinuousDeployment",
+ null
+ ]
+ },
+ "next-version": {
+ "description": "Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "no-bump-message": {
+ "format": "regex",
+ "description": "Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '[+=]semver:\\s?(none|skip)'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "default": "[+=]semver:\\s?(none|skip)",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "patch-version-bump-message": {
+ "format": "regex",
+ "description": "The regular expression to match commit messages with to perform a patch version increment. Defaults to '[+=]semver:\\s?(fix|patch)'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "default": "[+=]semver:\\s?(fix|patch)",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "prevent-increment": {
+ "description": "The prevent increment configuration section.",
+ "$ref": "#/$defs/preventIncrementConfiguration"
+ },
+ "regex": {
+ "format": "regex",
+ "description": "The regular expression pattern to use to match this branch. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "semantic-version-format": {
+ "description": "Specifies the semantic version format that is used when parsing the string. Can be 'Strict' or 'Loose'. Defaults to 'Strict'.",
+ "default": "Strict",
+ "enum": [
+ "Strict",
+ "Loose"
+ ]
+ },
+ "source-branches": {
+ "description": "The source branches for this branch.",
+ "$ref": "#/$defs/hashSetOfString"
+ },
+ "strategies": {
+ "description": "Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: 'ConfiguredNextVersion', 'MergeMessage', 'TaggedCommit', 'TrackReleaseBranches', 'VersionInBranchName' and 'Mainline'.",
+ "type": "array",
+ "items": {
"enum": [
- "ManualDeployment",
- "ContinuousDelivery",
- "ContinuousDeployment",
- null
- ]
- },
- "pre-release-weight": {
- "description": "Provides a way to translate the PreReleaseLabelName to a number.",
- "type": [
- "null",
- "integer"
- ]
- },
- "prevent-increment": {
- "description": "The prevent increment configuration section.",
- "$ref": "#/$defs/preventIncrementConfiguration"
- },
- "regex": {
- "format": "regex",
- "description": "The regular expression pattern to use to match this branch. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "type": [
- "null",
- "string"
- ]
- },
- "source-branches": {
- "description": "The source branches for this branch.",
- "$ref": "#/$defs/hashSetOfString"
- },
- "track-merge-message": {
- "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.",
- "type": [
- "null",
- "boolean"
- ]
- },
- "track-merge-target": {
- "description": "Strategy which will look for tagged merge commits directly off the current branch.",
- "type": [
- "null",
- "boolean"
- ]
- },
- "tracks-release-branches": {
- "description": "Indicates this branch configuration represents develop in GitFlow.",
- "type": [
- "null",
- "boolean"
+ "None",
+ "Fallback",
+ "ConfiguredNextVersion",
+ "MergeMessage",
+ "TaggedCommit",
+ "TrackReleaseBranches",
+ "VersionInBranchName",
+ "Mainline"
]
}
+ },
+ "tag-prefix": {
+ "format": "regex",
+ "description": "A regular expression which is used to trim Git tags before processing. Defaults to '[vV]?'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "default": "[vV]?",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "track-merge-message": {
+ "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ "track-merge-target": {
+ "description": "Strategy which will look for tagged merge commits directly off the current branch.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ "tracks-release-branches": {
+ "description": "Indicates this branch configuration represents develop in GitFlow.",
+ "type": [
+ "null",
+ "boolean"
+ ]
+ },
+ "version-bump-reset-message": {
+ "format": "regex",
+ "description": "The regular expression to match commit messages that reset the version bump baseline and suppress the configured branch increment. Defaults to '=semver:'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "default": "=semver:",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "version-in-branch-pattern": {
+ "format": "regex",
+ "description": "A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). Defaults to '(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
+ "default": "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*",
+ "type": [
+ "null",
+ "string"
+ ]
}
- }
- },
- "commit-date-format": {
- "description": "The format to use when calculating the commit date. Defaults to 'yyyy-MM-dd'. See [Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).",
- "default": "yyyy-MM-dd",
- "type": [
- "null",
- "string"
- ]
- },
- "commit-message-incrementing": {
- "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.",
- "enum": [
- "Enabled",
- "Disabled",
- "MergeMessageOnly",
- null
- ]
+ },
+ "additionalProperties": false
},
- "custom-version-format": {
- "description": "Specifies the format of CustomVersion.",
- "type": [
- "null",
- "string"
- ]
- },
- "ignore": {
- "description": "The header property for the ignore configuration.",
+ "output": {
+ "description": "Settings that affect assembly, build-server, and formatted version output.",
"type": "object",
"properties": {
+ "assembly-file-versioning-format": {
+ "description": "Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "assembly-file-versioning-scheme": {
+ "description": "The scheme to use when setting AssemblyFileVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.",
+ "default": "MajorMinorPatch",
+ "enum": [
+ "MajorMinorPatchTag",
+ "MajorMinorPatch",
+ "MajorMinor",
+ "Major",
+ "None",
+ null
+ ]
+ },
+ "assembly-informational-format": {
+ "description": "Specifies the format of AssemblyInformationalVersion. Defaults to '{InformationalVersion}'.",
+ "default": "'{InformationalVersion}'",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "assembly-versioning-format": {
+ "description": "Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "assembly-versioning-scheme": {
+ "description": "The scheme to use when setting AssemblyVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.",
+ "default": "MajorMinorPatch",
+ "enum": [
+ "MajorMinorPatchTag",
+ "MajorMinorPatch",
+ "MajorMinor",
+ "Major",
+ "None",
+ null
+ ]
+ },
"branches": {
- "description": "A sequence of regular expressions matching branch names without the remote prefix to be excluded as version sources. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "$ref": "#/$defs/hashSetOfString"
+ "description": "The header for all the individual branch configuration.",
+ "type": "object",
+ "additionalProperties": {
+ "type": "object",
+ "properties": {
+ "custom-version-format": {
+ "description": "Specifies the format of CustomVersion.",
+ "type": [
+ "null",
+ "string"
+ ]
+ },
+ "pre-release-weight": {
+ "description": "Provides a way to translate the PreReleaseLabelName to a number.",
+ "type": [
+ "null",
+ "integer"
+ ]
+ }
+ },
+ "additionalProperties": false
+ }
},
- "commits-before": {
- "format": "date-time",
- "description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.",
+ "commit-date-format": {
+ "description": "The format to use when calculating the commit date. Defaults to 'yyyy-MM-dd'. See [Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).",
+ "default": "yyyy-MM-dd",
"type": [
"null",
"string"
]
},
- "paths": {
- "description": "A sequence of regular expressions matching file paths to be excluded from the version calculations. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "$ref": "#/$defs/hashSetOfString"
+ "custom-version-format": {
+ "description": "Specifies the format of CustomVersion.",
+ "type": [
+ "null",
+ "string"
+ ]
},
- "sha": {
- "description": "A sequence of SHAs to be excluded from the version calculations.",
- "$ref": "#/$defs/hashSetOfString"
+ "pre-release-weight": {
+ "description": "Provides a way to translate the PreReleaseLabelName to a number.",
+ "type": [
+ "null",
+ "integer"
+ ]
},
- "tags": {
- "description": "A sequence of regular expressions matching friendly tag names to be excluded as version sources. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "$ref": "#/$defs/hashSetOfString"
+ "tag-pre-release-weight": {
+ "description": "The pre-release weight in case of tagged commits. Defaults to 60000.",
+ "type": [
+ "null",
+ "integer"
+ ]
+ },
+ "update-build-number": {
+ "description": "Whether to update the build number in the project file. Defaults to true.",
+ "default": "true",
+ "type": "boolean"
}
- }
- },
- "increment": {
- "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.",
- "$ref": "#/$defs/incrementStrategy"
- },
- "is-main-branch": {
- "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.",
- "type": [
- "null",
- "boolean"
- ]
- },
- "is-release-branch": {
- "description": "Indicates this branch configuration represents a release branch in GitFlow.",
- "type": [
- "null",
- "boolean"
- ]
- },
- "is-source-branch-for": {
- "description": "The branches that this branch is a source branch.",
- "$ref": "#/$defs/hashSetOfString"
- },
- "label": {
- "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).",
- "type": [
- "null",
- "string"
- ]
- },
- "major-version-bump-message": {
- "format": "regex",
- "description": "The regular expression to match commit messages with to perform a major version increment. Defaults to '[+=]semver:\\s?(breaking|major)'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "default": "[+=]semver:\\s?(breaking|major)",
- "type": [
- "null",
- "string"
- ]
- },
- "merge-message-formats": {
- "description": "Custom regular expression merge message formats to enable identification of merge messages that do not follow the built-in conventions. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- "minor-version-bump-message": {
- "format": "regex",
- "description": "The regular expression to match commit messages with to perform a minor version increment. Defaults to '[+=]semver:\\s?(feature|minor)'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "default": "[+=]semver:\\s?(feature|minor)",
- "type": [
- "null",
- "string"
- ]
- },
- "mode": {
- "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.",
- "enum": [
- "ManualDeployment",
- "ContinuousDelivery",
- "ContinuousDeployment",
- null
- ]
- },
- "next-version": {
- "description": "Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes",
- "type": [
- "null",
- "string"
- ]
- },
- "no-bump-message": {
- "format": "regex",
- "description": "Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '[+=]semver:\\s?(none|skip)'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "default": "[+=]semver:\\s?(none|skip)",
- "type": [
- "null",
- "string"
- ]
- },
- "patch-version-bump-message": {
- "format": "regex",
- "description": "The regular expression to match commit messages with to perform a patch version increment. Defaults to '[+=]semver:\\s?(fix|patch)'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "default": "[+=]semver:\\s?(fix|patch)",
- "type": [
- "null",
- "string"
- ]
- },
- "pre-release-weight": {
- "description": "Provides a way to translate the PreReleaseLabelName to a number.",
- "type": [
- "null",
- "integer"
- ]
- },
- "prevent-increment": {
- "description": "The prevent increment configuration section.",
- "$ref": "#/$defs/preventIncrementConfiguration"
- },
- "regex": {
- "format": "regex",
- "description": "The regular expression pattern to use to match this branch. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "type": [
- "null",
- "string"
- ]
- },
- "semantic-version-format": {
- "description": "Specifies the semantic version format that is used when parsing the string. Can be 'Strict' or 'Loose'. Defaults to 'Strict'.",
- "default": "Strict",
- "enum": [
- "Strict",
- "Loose"
- ]
- },
- "source-branches": {
- "description": "The source branches for this branch.",
- "$ref": "#/$defs/hashSetOfString"
- },
- "strategies": {
- "description": "Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: 'ConfiguredNextVersion', 'MergeMessage', 'TaggedCommit', 'TrackReleaseBranches', 'VersionInBranchName' and 'Mainline'.",
- "type": "array",
- "items": {
- "enum": [
- "None",
- "Fallback",
- "ConfiguredNextVersion",
- "MergeMessage",
- "TaggedCommit",
- "TrackReleaseBranches",
- "VersionInBranchName",
- "Mainline"
- ]
- }
- },
- "tag-pre-release-weight": {
- "description": "The pre-release weight in case of tagged commits. Defaults to 60000.",
- "type": [
- "null",
- "integer"
- ]
- },
- "tag-prefix": {
- "format": "regex",
- "description": "A regular expression which is used to trim Git tags before processing. Defaults to '[vV]?'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "default": "[vV]?",
- "type": [
- "null",
- "string"
- ]
- },
- "track-merge-message": {
- "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.",
- "type": [
- "null",
- "boolean"
- ]
- },
- "track-merge-target": {
- "description": "Strategy which will look for tagged merge commits directly off the current branch.",
- "type": [
- "null",
- "boolean"
- ]
- },
- "tracks-release-branches": {
- "description": "Indicates this branch configuration represents develop in GitFlow.",
- "type": [
- "null",
- "boolean"
- ]
- },
- "update-build-number": {
- "description": "Whether to update the build number in the project file. Defaults to true.",
- "default": "true",
- "type": "boolean"
- },
- "version-bump-reset-message": {
- "format": "regex",
- "description": "The regular expression to match commit messages that reset the version bump baseline and suppress the configured branch increment. Defaults to '=semver:'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "default": "=semver:",
- "type": [
- "null",
- "string"
- ]
- },
- "version-in-branch-pattern": {
- "format": "regex",
- "description": "A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). Defaults to '(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*'. Matching is case-insensitive by default; use (?-i) to enable case-sensitive matching.",
- "default": "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*",
- "type": [
- "null",
- "string"
- ]
+ },
+ "additionalProperties": false
},
"workflow": {
"description": "The base template of the configuration to use. Possible values are: 'GitFlow/v1' or 'GitHubFlow/v1'",
@@ -457,5 +482,6 @@
}
}
}
- }
+ },
+ "additionalProperties": false
}
\ No newline at end of file
diff --git a/src/GitVersion.App.Tests/ArgumentParserTests.cs b/src/GitVersion.App.Tests/ArgumentParserTests.cs
index 2b9bd12c8f..bfd495b02c 100644
--- a/src/GitVersion.App.Tests/ArgumentParserTests.cs
+++ b/src/GitVersion.App.Tests/ArgumentParserTests.cs
@@ -9,21 +9,166 @@
namespace GitVersion.App.Tests;
[TestFixture]
+[NonParallelizable]
public class ArgumentParserTests : TestBase
{
private IEnvironment environment = null!;
private IArgumentParser argumentParser = null!;
private IFileSystem fileSystem = null!;
+ private string? originalConfigurationVersion;
[SetUp]
public void SetUp()
{
+ this.originalConfigurationVersion = System.Environment.GetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName);
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v6");
var sp = ConfigureServices(services => services.AddModule(new GitVersionAppModule()));
this.environment = sp.GetRequiredService();
this.argumentParser = sp.GetRequiredService();
this.fileSystem = sp.GetRequiredService();
}
+ [TearDown]
+ public void TearDown() =>
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, this.originalConfigurationVersion);
+
+ [Test]
+ public void OverrideConfigSupportsNestedV7RootAndBranchPaths()
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v7");
+
+ var arguments = this.argumentParser.ParseArguments(
+ "--override-config workflow=GitHubFlow/v1 " +
+ "--override-config calculation.tag-prefix=custom- " +
+ "--override-config calculation.branches.main.increment=Major " +
+ "--override-config output.branches.main.pre-release-weight=42");
+
+ var normalized = ConfigurationDocumentMapper.Normalize(
+ arguments.OverrideConfiguration!, ConfigurationVersion.V7, "test override");
+ ConfigurationHelper configurationHelper = new(normalized);
+ var configuration = configurationHelper.Configuration;
+ configuration.Workflow.ShouldBe("GitHubFlow/v1");
+ configuration.TagPrefixPattern.ShouldBe("custom-");
+ configuration.Branches["main"].Increment.ShouldBe(IncrementStrategy.Major);
+ configuration.Branches["main"].PreReleaseWeight.ShouldBe(42);
+ }
+
+ [TestCase("v6")]
+ [TestCase("v7")]
+ public void OverrideConfigAcceptsWorkflowOnlyInEitherVersion(string version)
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, version);
+
+ var arguments = this.argumentParser.ParseArguments("--override-config Workflow=GitHubFlow/v1");
+
+ arguments.OverrideConfiguration!.Count.ShouldBe(1);
+ arguments.OverrideConfiguration["workflow"].ShouldBe("GitHubFlow/v1");
+ }
+
+ [TestCase("calculation")]
+ [TestCase("output")]
+ public void OverrideConfigRejectsNestedWorkflowWithRootReplacement(string section)
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v7");
+
+ var exception = Should.Throw(() =>
+ this.argumentParser.ParseArguments($"--override-config {section}.workflow=GitHubFlow/v1"));
+
+ exception.Message.ShouldContain($"{section}.workflow");
+ exception.Message.ShouldContain("'workflow'");
+ }
+
+ [Test]
+ public void OverrideConfigPreservesV7BranchNameCasing()
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v7");
+
+ var arguments = this.argumentParser.ParseArguments(
+ "--override-config Calculation.Branches.ReleaseCandidate.Increment=Major");
+
+ var normalized = ConfigurationDocumentMapper.Normalize(
+ arguments.OverrideConfiguration!, ConfigurationVersion.V7, "test override");
+ ConfigurationHelper configurationHelper = new(normalized);
+ configurationHelper.Configuration.Branches["ReleaseCandidate"].Increment.ShouldBe(IncrementStrategy.Major);
+ }
+
+ [Test]
+ public void OverrideConfigRejectsDottedV7BranchNameWithClearDiagnostic()
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v7");
+
+ var exception = Should.Throw(() =>
+ this.argumentParser.ParseArguments(
+ "--override-config calculation.branches.release.1.increment=Major"));
+
+ exception.Message.ShouldContain("Branch name 'release.1' contains '.'");
+ exception.Message.ShouldContain("Use a configuration file instead");
+ }
+
+ [Test]
+ public void OverrideConfigRejectsV6PathInV7WithReplacement()
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v7");
+
+ var exception = Should.Throw(() =>
+ this.argumentParser.ParseArguments("--override-config tag-prefix=custom-"));
+
+ exception.Message.ShouldContain("calculation.tag-prefix");
+ exception.Message.ShouldContain("config migrate");
+ }
+
+ [Test]
+ public void OverrideConfigRejectsPropertyInWrongV7SectionWithReplacement()
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v7");
+
+ var exception = Should.Throw(() =>
+ this.argumentParser.ParseArguments("--override-config calculation.update-build-number=false"));
+
+ exception.Message.ShouldContain("output.update-build-number");
+ }
+
+ [Test]
+ public void OverrideConfigSupportsV6BranchPath()
+ {
+ var arguments = this.argumentParser.ParseArguments("--override-config branches.main.increment=Major");
+
+ ConfigurationHelper configurationHelper = new(arguments.OverrideConfiguration);
+ configurationHelper.Configuration.Branches["main"].Increment.ShouldBe(IncrementStrategy.Major);
+ }
+
+ [Test]
+ public void OverrideConfigPreservesV6BranchNameCasing()
+ {
+ var arguments = this.argumentParser.ParseArguments(
+ "--override-config Branches.ReleaseCandidate.Increment=Major");
+
+ ConfigurationHelper configurationHelper = new(arguments.OverrideConfiguration);
+ configurationHelper.Configuration.Branches["ReleaseCandidate"].Increment.ShouldBe(IncrementStrategy.Major);
+ }
+
+ [Test]
+ public void OverrideConfigRejectsV7PathInV6WithReplacement()
+ {
+ var exception = Should.Throw(() =>
+ this.argumentParser.ParseArguments("--override-config output.update-build-number=false"));
+
+ exception.Message.ShouldContain("update-build-number");
+ exception.Message.ShouldContain("config migrate");
+ }
+
+ [Test]
+ public void OverrideConfigBatchValidationDoesNotApplyAnyValues()
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v7");
+ var parser = new OverrideConfigurationOptionParser();
+
+ Should.Throw(() => parser.SetValues(
+ ["calculation.tag-prefix=custom-", "tag-prefix=legacy"], "--override-config"));
+
+ parser.GetOverrideConfiguration().ShouldBeEmpty();
+ }
+
[Test]
public void EmptyMeansUseCurrentDirectory()
{
diff --git a/src/GitVersion.App.Tests/ConfigurationVersionIntegrationTests.cs b/src/GitVersion.App.Tests/ConfigurationVersionIntegrationTests.cs
new file mode 100644
index 0000000000..5d4e486f9e
--- /dev/null
+++ b/src/GitVersion.App.Tests/ConfigurationVersionIntegrationTests.cs
@@ -0,0 +1,90 @@
+using GitVersion.App.Tests.Helpers;
+using GitVersion.Configuration;
+using GitVersion.Helpers;
+
+namespace GitVersion.App.Tests;
+
+[TestFixture]
+public class ConfigurationVersionIntegrationTests
+{
+ [Test]
+ public void V6AndV7ConfigurationCalculateTheSameVersion()
+ {
+ using var fixture = new EmptyRepositoryFixture();
+ fixture.MakeACommit();
+ var configurationPath = FileSystemHelper.Path.Combine(fixture.RepositoryPath, ConfigurationFileLocator.DefaultFileName);
+
+ FileSystemHelper.File.WriteAllText(configurationPath, "next-version: 2.0.0");
+ var v6Result = Execute(fixture.RepositoryPath, "v6");
+
+ FileSystemHelper.File.WriteAllText(configurationPath, """
+ calculation:
+ next-version: 2.0.0
+ output: {}
+ """);
+ var v7Result = Execute(fixture.RepositoryPath, "v7");
+
+ v6Result.ExitCode.ShouldBe(0);
+ v7Result.ExitCode.ShouldBe(0);
+ GetFullSemVer(v7Result.Output!).ShouldBe(GetFullSemVer(v6Result.Output!));
+ }
+
+ [TestCase("v6", false)]
+ [TestCase("v7", true)]
+ public void ShowConfigUsesSelectedConfigurationStructure(string version, bool nested)
+ {
+ using var fixture = new EmptyRepositoryFixture();
+ var result = GitVersionHelper.ExecuteIn(
+ fixture.RepositoryPath,
+ " --show-config",
+ logToFile: false,
+ new KeyValuePair(ConfigurationVersionSelector.EnvironmentVariableName, version));
+
+ result.ExitCode.ShouldBe(0);
+ result.Output.ShouldNotBeNull();
+ result.Output.Contains("calculation:", StringComparison.Ordinal).ShouldBe(nested);
+ result.Output.Contains("output:", StringComparison.Ordinal).ShouldBe(nested);
+ }
+
+ [Test]
+ public void DefaultCalculationDisplaysConfigurationVersionMismatchOnStandardError()
+ {
+ using var fixture = new EmptyRepositoryFixture();
+ fixture.MakeACommit();
+ var configurationPath = FileSystemHelper.Path.Combine(fixture.RepositoryPath, ConfigurationFileLocator.DefaultFileName);
+ FileSystemHelper.File.WriteAllText(configurationPath, "next-version: 2.0.0");
+
+ var result = Execute(fixture.RepositoryPath, "v7");
+
+ result.ExitCode.ShouldBe(1);
+ result.Output.ShouldNotBeNull();
+ result.Output.ShouldContain("An error occurred:");
+ result.Output.ShouldContain("uses the legacy v6 configuration structure");
+ result.Output.ShouldContain("gitversion config migrate");
+ }
+
+ [Test]
+ public void InvalidConfigurationVersionDisplaysDiagnosticOnStandardError()
+ {
+ using var fixture = new EmptyRepositoryFixture();
+ fixture.MakeACommit();
+
+ var result = Execute(fixture.RepositoryPath, "invalid");
+
+ result.ExitCode.ShouldBe(1);
+ result.Output.ShouldNotBeNull();
+ result.Output.ShouldContain("An error occurred:");
+ result.Output.ShouldContain("Unrecognized GITVERSION_CONFIGURATION_VERSION value 'invalid'");
+ result.Output.ShouldContain("Valid values are 'v6' and 'v7'");
+ }
+
+ private static ExecutionResults Execute(string repositoryPath, string version) =>
+ GitVersionHelper.ExecuteIn(
+ repositoryPath,
+ arguments: null,
+ logToFile: false,
+ new KeyValuePair(ConfigurationVersionSelector.EnvironmentVariableName, version));
+
+ private static string? GetFullSemVer(string json) =>
+ JsonDocument.Parse(json).RootElement.GetProperty("FullSemVer").GetString();
+}
diff --git a/src/GitVersion.App.Tests/LegacyArgumentParserTests.cs b/src/GitVersion.App.Tests/LegacyArgumentParserTests.cs
index deee50c64d..42fc182b28 100644
--- a/src/GitVersion.App.Tests/LegacyArgumentParserTests.cs
+++ b/src/GitVersion.App.Tests/LegacyArgumentParserTests.cs
@@ -9,21 +9,60 @@
namespace GitVersion.App.Tests;
[TestFixture]
+[NonParallelizable]
public class LegacyArgumentParserTests : TestBase
{
private IEnvironment environment = null!;
private IArgumentParser argumentParser = null!;
private IFileSystem fileSystem = null!;
+ private string? originalConfigurationVersion;
[SetUp]
public void SetUp()
{
+ this.originalConfigurationVersion = System.Environment.GetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName);
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v6");
var sp = ConfigureServices(services => services.AddModule(new GitVersionAppModule(useLegacyParser: true)));
this.environment = sp.GetRequiredService();
this.argumentParser = sp.GetRequiredService();
this.fileSystem = sp.GetRequiredService();
}
+ [TearDown]
+ public void TearDown() =>
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, this.originalConfigurationVersion);
+
+ [Test]
+ public void OverrideConfigSupportsNestedV7RootAndBranchPaths()
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v7");
+
+ var arguments = this.argumentParser.ParseArguments(
+ "/overrideconfig calculation.tag-prefix=custom- " +
+ "/overrideconfig calculation.branches.main.increment=Major " +
+ "/overrideconfig output.branches.main.pre-release-weight=42");
+
+ var normalized = ConfigurationDocumentMapper.Normalize(
+ arguments.OverrideConfiguration!, ConfigurationVersion.V7, "test override");
+ ConfigurationHelper configurationHelper = new(normalized);
+ var configuration = configurationHelper.Configuration;
+ configuration.TagPrefixPattern.ShouldBe("custom-");
+ configuration.Branches["main"].Increment.ShouldBe(IncrementStrategy.Major);
+ configuration.Branches["main"].PreReleaseWeight.ShouldBe(42);
+ }
+
+ [Test]
+ public void OverrideConfigRejectsV6PathInV7WithReplacement()
+ {
+ System.Environment.SetEnvironmentVariable(ConfigurationVersionSelector.EnvironmentVariableName, "v7");
+
+ var exception = Should.Throw(() =>
+ this.argumentParser.ParseArguments("/overrideconfig tag-prefix=custom-"));
+
+ exception.Message.ShouldContain("calculation.tag-prefix");
+ exception.Message.ShouldContain("config migrate");
+ }
+
[Test]
public void EmptyMeansUseCurrentDirectory()
{
diff --git a/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs b/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs
index 408d50dc65..ee9dcc623b 100644
--- a/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs
+++ b/src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs
@@ -151,9 +151,11 @@ public async Task VerifyBitBucketPipelinesPullRequest(string pullRequestRef)
private const string GitLabMergeRequestPullRequestConfig = """
workflow: GitFlow/v1
- branches:
- pull-request:
- regex: ^merge-requests/(?\d+)/(head|merge)$
+ calculation:
+ branches:
+ pull-request:
+ regex: ^merge-requests/(?\d+)/(head|merge)$
+ output: {}
""";
private static async Task VerifyGitLabMergeRequestVersionIsCalculatedProperly(string mergeRequestRef, Dictionary env)
diff --git a/src/GitVersion.App/ArgumentParser.cs b/src/GitVersion.App/ArgumentParser.cs
index efdf5c24b0..2486f545cc 100644
--- a/src/GitVersion.App/ArgumentParser.cs
+++ b/src/GitVersion.App/ArgumentParser.cs
@@ -371,7 +371,7 @@ Runs GitVersion with additional diagnostic information.
};
var overrideConfig = new Option("--override-config")
{
- Description = "Overrides GitVersion config values inline (key=value pairs e.g. --override-config tag-prefix=Foo)",
+ Description = "Overrides GitVersion config values inline (key=value pairs e.g. --override-config workflow=GitHubFlow/v1)",
AllowMultipleArgumentsPerToken = false,
Arity = ArgumentArity.ZeroOrMore
};
@@ -591,24 +591,7 @@ private static void ParseOverrideConfig(Arguments arguments, IReadOnlyCollection
}
var parser = new OverrideConfigurationOptionParser();
-
- foreach (var keyValueOption in values)
- {
- var keyAndValue = QuotedStringHelpers.SplitUnquoted(keyValueOption, '=');
- if (keyAndValue.Length != 2)
- {
- throw new WarningException($"Could not parse --override-config option: {keyValueOption}. Ensure it is in format 'key=value'.");
- }
-
- var optionKey = keyAndValue[0].ToLowerInvariant();
- if (!OverrideConfigurationOptionParser.SupportedProperties.Contains(optionKey))
- {
- throw new WarningException($"Could not parse --override-config option: {keyValueOption}. Unsupported key '{optionKey}'.");
- }
-
- parser.SetValue(optionKey, keyAndValue[1]);
- }
-
+ parser.SetValues(values, "--override-config");
arguments.OverrideConfiguration = parser.GetOverrideConfiguration();
}
diff --git a/src/GitVersion.App/GitVersionExecutor.cs b/src/GitVersion.App/GitVersionExecutor.cs
index 1d102033c4..2bd462d3f8 100644
--- a/src/GitVersion.App/GitVersionExecutor.cs
+++ b/src/GitVersion.App/GitVersionExecutor.cs
@@ -70,8 +70,9 @@ private int RunGitVersionTool(GitVersionOptions gitVersionOptions)
this.gitVersionOutputTool.UpdateAssemblyInfo(variables);
this.gitVersionOutputTool.UpdateWixVersionFile(variables);
}
- catch (WarningException exception)
+ catch (Exception exception) when (exception is WarningException or ConfigurationException)
{
+ WriteError(exception);
this.logger.LogError(exception, """
An error occurred:
{Message}
@@ -103,6 +104,12 @@ private int RunGitVersionTool(GitVersionOptions gitVersionOptions)
return 0;
}
+ private static void WriteError(Exception exception)
+ {
+ Console.Error.WriteLine("An error occurred:");
+ Console.Error.WriteLine(exception.Message);
+ }
+
private void Initialize(GitVersionOptions gitVersionOptions)
{
if (gitVersionOptions.Diag)
diff --git a/src/GitVersion.App/LegacyArgumentParser.cs b/src/GitVersion.App/LegacyArgumentParser.cs
index 896f74f3ce..24a8410bfc 100644
--- a/src/GitVersion.App/LegacyArgumentParser.cs
+++ b/src/GitVersion.App/LegacyArgumentParser.cs
@@ -511,25 +511,7 @@ private static void ParseOverrideConfig(Arguments arguments, IReadOnlyCollection
}
var parser = new OverrideConfigurationOptionParser();
-
- // key=value
- foreach (var keyValueOption in values)
- {
- var keyAndValue = QuotedStringHelpers.SplitUnquoted(keyValueOption, '=');
- if (keyAndValue.Length != 2)
- {
- throw new WarningException($"Could not parse /overrideconfig option: {keyValueOption}. Ensure it is in format 'key=value'.");
- }
-
- var optionKey = keyAndValue[0].ToLowerInvariant();
- if (!OverrideConfigurationOptionParser.SupportedProperties.Contains(optionKey))
- {
- throw new WarningException($"Could not parse /overrideconfig option: {keyValueOption}. Unsupported key '{optionKey}'.");
- }
-
- parser.SetValue(optionKey, keyAndValue[1]);
- }
-
+ parser.SetValues(values, "/overrideconfig");
arguments.OverrideConfiguration = parser.GetOverrideConfiguration();
}
diff --git a/src/GitVersion.App/OverrideConfigurationOptionParser.cs b/src/GitVersion.App/OverrideConfigurationOptionParser.cs
index 9b7a3ee403..a0eea8641d 100644
--- a/src/GitVersion.App/OverrideConfigurationOptionParser.cs
+++ b/src/GitVersion.App/OverrideConfigurationOptionParser.cs
@@ -12,6 +12,9 @@ internal class OverrideConfigurationOptionParser
internal static ILookup SupportedProperties => _lazySupportedProperties.Value;
+ private static readonly Lazy> _lazySupportedBranchProperties =
+ new(GetSupportedBranchProperties, true);
+
///
/// Dynamically creates of
/// properties supported as a part of command line '/overrideconfig' option.
@@ -50,7 +53,241 @@ private static bool IsSupportedPropertyType(Type propertyType)
|| unwrappedType == typeof(VersionStrategies[]);
}
- internal void SetValue(string key, string value) => this.overrideConfiguration[key] = QuotedStringHelpers.UnquoteText(value);
+ private static bool TryNormalizeAndValidate(string key, out string normalizedKey, out string? error)
+ {
+ var version = ConfigurationVersionSelector.Resolve();
+ var segments = key.Split('.');
+ NormalizeSegments(segments);
+ normalizedKey = string.Join('.', segments);
+
+ if (IsAmbiguousBranchPath(segments, out var branchName))
+ {
+ error = $"Branch name '{branchName}' contains '.', which cannot be addressed by an override configuration path. " +
+ "Use a configuration file instead.";
+ return false;
+ }
+
+ if (IsValidPath(version, segments))
+ {
+ error = null;
+ return true;
+ }
+
+ var replacement = GetReplacement(version, segments);
+ error = replacement is null
+ ? $"Unsupported key '{normalizedKey}'."
+ : $"Key '{normalizedKey}' is not valid in the selected configuration structure. Use '{replacement}' instead. " +
+ "Run 'gitversion config migrate' to convert a legacy configuration.";
+ return false;
+ }
+
+ internal void SetValues(IReadOnlyCollection values, string optionName)
+ {
+ List<(string Key, string Value)> parsedOptions = [];
+
+ foreach (var keyValueOption in values)
+ {
+ var keyAndValue = QuotedStringHelpers.SplitUnquoted(keyValueOption, '=');
+ if (keyAndValue.Length != 2)
+ {
+ throw new WarningException($"Could not parse {optionName} option: {keyValueOption}. Ensure it is in format 'key=value'.");
+ }
+
+ if (!TryNormalizeAndValidate(keyAndValue[0], out var optionKey, out var error))
+ {
+ throw new WarningException($"Could not parse {optionName} option: {keyValueOption}. {error}");
+ }
+
+ parsedOptions.Add((optionKey, keyAndValue[1]));
+ }
+
+ foreach (var (key, value) in parsedOptions)
+ {
+ SetValue(key, value);
+ }
+ }
+
+ internal void SetValue(string key, string value)
+ {
+ var segments = key.Split('.');
+ IDictionary