We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 072f141 commit ed8cf08Copy full SHA for ed8cf08
scripts/get-current-info.sh
@@ -3,6 +3,20 @@
3
set -o errexit -o nounset -o pipefail
4
5
BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)"
6
+TAG_NAME="$(git describe --tags)"
7
SHORT_COMMIT_HASH="$(git rev-parse --short=8 HEAD)"
8
-echo "{ \"version\": \"${BRANCH_NAME}@${SHORT_COMMIT_HASH}\" }"
9
+if [ "${BRANCH_NAME}" == "HEAD" ]; then
10
+ NRLF_VERSION="${TAG_NAME}@${SHORT_COMMIT_HASH}"
11
+else
12
+ NRLF_VERSION="${BRANCH_NAME}@${SHORT_COMMIT_HASH}"
13
+fi
14
+
15
+cat << EOF
16
+{
17
+ "version": "${NRLF_VERSION}",
18
+ "tag": "${TAG_NAME}",
19
+ "branch": "${BRANCH_NAME}",
20
+ "commit": "${SHORT_COMMIT_HASH}"
21
+}
22
+EOF
0 commit comments