Skip to content

Commit 2a7bf8c

Browse files
committed
Script to just confirm tagged version matches code version
1 parent fd97ceb commit 2a7bf8c

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/check-version.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#! /bin/bash
2+
3+
set -ex
4+
5+
TAG=$(git describe --tags --abbrev=0)
6+
FILE_VERSION=$(sed -nE 's/var Version = "(.*)"/\1/p' cmd/version.go)
7+
8+
if [ "$TAG" != "v$FILE_VERSION" ]; then
9+
echo "Version mismatch: tag is $TAG but version.go has $FILE_VERSION"
10+
exit 1
11+
fi

cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
// Version of the CLI app.
11-
var Version = "0.1.0"
11+
var Version = "0.0.10"
1212

1313
// The command prints out the version of the CLI app.
1414
func init() {

0 commit comments

Comments
 (0)