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 4086a3e commit 43abbdeCopy full SHA for 43abbde
Makefile
@@ -31,7 +31,10 @@ fmtcheck:
31
test -z $(shell go fmt $(SOURCE))
32
.PHONY: fmtcheck
33
34
-tag:
+check-tag:
35
+ ./scripts/ensure-unique-version.sh "$(VERSION)"
36
+
37
+tag: check-tag
38
echo "creating git tag $(VERSION)"
39
git tag $(VERSION)
40
git push origin $(VERSION)
scripts/ensure-unique-version.sh
@@ -0,0 +1,17 @@
1
+#!/bin/sh
2
3
+version="${1}"
4
+repo="mdb/gh-dispatch"
5
6
+result="$(curl \
7
+ --header "Accept: application/vnd.github.v3+json" \
8
+ --write "%{http_code}" \
9
+ --out "/dev/null" \
10
+ "https://api.github.com/repos/${repo}/releases/tags/${version}")"
11
12
+if [ "${result}" = "404" ]; then
13
+ exit 0
14
+fi
15
16
+echo "${version} is an existing ${repo} release"
17
+exit 1
0 commit comments