Skip to content

Commit

Permalink
chore: get HEAD commit when version is missing tag (#777)
Browse files Browse the repository at this point in the history
Also, add more instructions to `bug_report.yml` on how to find
the ddns-go version.
  • Loading branch information
WaterLemons2k authored Jul 20, 2023
1 parent 68c59d0 commit b486804
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ body:
- type: input
attributes:
label: 版本
description: ddns-go 的版本或 commit,可运行 `ddns-go -v` 查看版本
description: ddns-go 的版本或 commit(可在网页右上角找到,或运行 `ddns-go -v` 查看版本
placeholder: v0.0.1
validations:
required: true
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.PHONY: build clean test test-race

VERSION=$(shell git describe --tags `git rev-list --tags --max-count=1`)
# 如果找不到 tag 则使用 HEAD commit
VERSION=$(shell git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null || git rev-parse --short HEAD)
BUILD_TIME=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
BIN=ddns-go
DIR_SRC=.
Expand Down

0 comments on commit b486804

Please sign in to comment.