Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improve message when failed to determine git branch #61

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/dotnet-releaser/GitInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ private GitInformation(Repository repository, Branch branch, string branchName)
{
logger.Error($@"Unable to retrieve the current branch from the commit {repository.Head.Tip.Sha}. The current action requires it. Please make sure that:
1) The current commit is a checkout on a valid branch.
2) If running on GitHub Action, you are using `actions/checkout@v2` and not v1, but also that the property `fetch-depth: 0` is correctly setup.
2) If running on GitHub Action, you are using `actions/checkout@v4` and not v1, but also that the property `fetch-depth: 0` is correctly setup.
3) We have found the following branches containing this commit [{string.Join(",", repository.Branches.Select(x => x.FriendlyName))}].
4) You pushed only tags (`git push --tags`) and forget to push whole branch.h
");
return null;
}
Expand All @@ -70,4 +71,4 @@ private static string GetShortBranchName(Branch branch)

return branchName;
}
}
}
Loading