release.sh: refuse to pin from a non-master branch (the pin commit lands on master)
This commit is contained in:
1 parent
bb2503bb47
commit
2357d5d55a
1 file changed
+5
-1
+5
-1
@@ -49,6 +49,10 @@ cmd_build() {
|
||||
|
||||
cmd_pin() {
|
||||
local tag="${1:-}" ; [ -n "$tag" ] || die "usage: release.sh pin <tag>"
|
||||
local br; br=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [ "$br" != "master" ] && [ "${ALLOW_BRANCH:-0}" != "1" ]; then
|
||||
die "on branch '$br' — the pin commit goes to master, so merge your change first (or set ALLOW_BRANCH=1 if you really mean it)"
|
||||
fi
|
||||
python3 - "$tag" <<'PY'
|
||||
import json, sys
|
||||
tag = sys.argv[1]
|
||||
@@ -61,7 +65,7 @@ print(f'dockerImage: {old} -> {m["dockerImage"]}')
|
||||
PY
|
||||
git add "$MANIFEST"
|
||||
git commit -q -m "Pin manifest to $tag"
|
||||
git push -q origin HEAD:master
|
||||
git push -q
|
||||
ok "pinned + pushed $tag"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user