-
Notifications
You must be signed in to change notification settings - Fork 658
Description
Describe the bug
when build a tag commit on a jenkins agent, it failed and report
"[2021-11-29 16:47:39] WARN [11/29/21 16:47:39:51] An error occurred:
[2021-11-29 16:47:39] Failed to try and guess branch to use. Move one of the branches along a commit to remove warning"
Expected Behavior
build success
Actual Behavior
build failed
Possible Fix
if current commit tagged, not throw a excpetion.
throw new WarningException("Failed to try and guess branch to use. " + moveBranchMsg); |
Steps to Reproduce
- add a Environment Variable in Windows "JENKINS_URL" in Windows, act as a jenkins agent
- open a powershell and execute:
mkdir gitversionErrorTest
cd gitversionErrorTest
git init
git.exe config remote.origin.url https://github.com/hyabean/GitVersionBuildFail.git # timeout=10
git.exe fetch --tags --force --progress -- https://github.com/hyabean/GitVersionBuildFail.git +refs/heads/*:refs/remotes/origin/* +refs/merge/*:refs/remotes/origin/merge/*
git.exe rev-parse "b309af2d6845182e643eb60ee06ebe9aecf8425e^{commit}" # timeout=10
git.exe config core.sparsecheckout # timeout=10
git.exe checkout -f b309af2d6845182e643eb60ee06ebe9aecf8425e
dotnet-gitversion ".\src\TcWinApp" -output file -outputfile src\TcWinApp\obj\gitversion.json
Context
CI failed after tag
Your Environment
- Version Used:
- GitVersion Version 5.7.0