Skip to content

Commit 8774128

Browse files
authored
fix: use shorter commit sha in version output (runatlantis#3163)
1 parent 4bd0f70 commit 8774128

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ func main() {
4343
panic(fmt.Sprintf("unable to initialize logger. %s", err.Error()))
4444
}
4545

46-
atlantisVersion := fmt.Sprintf("%s (commit: %s) (build date: %s)", version, commit, date)
46+
var sha = commit
47+
if len(commit) >= 7 {
48+
sha = commit[:7]
49+
}
50+
51+
atlantisVersion := fmt.Sprintf("%s (commit: %s) (build date: %s)", version, sha, date)
4752

4853
// We're creating commands manually here rather than using init() functions
4954
// (as recommended by cobra) because it makes testing easier.

0 commit comments

Comments
 (0)