Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 16
    Maybe this is a given, but it should be noted that many CI engines checkout out the latest commit in a detached state, instead of master or a named branch. In that case, this solution will return HEAD, not the branch name. Commented Sep 25, 2019 at 8:07
  • See this for an alternative that won't break the configuration cache. Commented Jul 29, 2023 at 1:31
  • @JørgenSivesind do you have a solution for CI? Commented Jan 17 at 7:20