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 26f0389 commit a7ad827Copy full SHA for a7ad827
Makefile
@@ -2,7 +2,12 @@ GIT_TAG?= $(shell git describe --always --tags)
2
BIN = gosec
3
FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr)
4
IMAGE_REPO = securego
5
-BUILD_DATE ?= $(shell date +%Y-%m-%d)
+DATE_FMT=+%Y-%m-%d
6
+ifdef SOURCE_DATE_EPOCH
7
+ BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)")
8
+else
9
+ BUILD_DATE ?= $(shell date "$(DATE_FMT)")
10
+endif
11
BUILDFLAGS := "-w -s -X 'main.Version=$(GIT_TAG)' -X 'main.GitTag=$(GIT_TAG)' -X 'main.BuildDate=$(BUILD_DATE)'"
12
CGO_ENABLED = 0
13
GO := GO111MODULE=on go
0 commit comments