mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 05:40:11 +01:00
Improve Makefile to better set version number
* Add --always to git describe to also return if we are run on a shallow clone in a git hub action with action/checkout.
This commit is contained in:
parent
dca6f2c5c4
commit
89edf94cee
1 changed files with 3 additions and 2 deletions
5
Makefile
5
Makefile
|
|
@ -42,8 +42,9 @@ tag_checked_out:
|
|||
# any commit after a tag is considered newer than the semver from the tag
|
||||
# without an optional 'v'
|
||||
# Note we need `--tags` because github release only creates lightweight tags
|
||||
# (see feature request https://github.com/github/feedback/discussions/4924)
|
||||
GITDESC := $(shell git describe --tags)
|
||||
# (see feature request https://github.com/github/feedback/discussions/4924).
|
||||
# We use `--always` in case of being run as github action with shallow clone.
|
||||
GITDESC := $(shell git describe --tags --always)
|
||||
GITDESCPATCH := $(shell echo '$(GITDESC)' | sed -E 's/v?[0-9]+\.[0-9]+\.([0-9]+)[-+]?.*/\1/')
|
||||
SEMVERPATCH := $(shell echo $$(( $(GITDESCPATCH) + 1 )))
|
||||
# Hint: The regexp in the next line only matches if there is a hyphen (`-`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue