From 83333ac1f89c5a682e9cf518de26803ca9ff7a9c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 21 Nov 2023 08:45:30 -0600 Subject: [PATCH] checkout-latest-tag: Exit with error in the case of any failures --- tools/git-checkout-latest-tag.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/git-checkout-latest-tag.sh b/tools/git-checkout-latest-tag.sh index 69fa2ced4f..243e52efda 100755 --- a/tools/git-checkout-latest-tag.sh +++ b/tools/git-checkout-latest-tag.sh @@ -1,8 +1,11 @@ #!/bin/bash +set -eo pipefail + # SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) # # SPDX-License-Identifier: MIT git fetch --tags -git checkout $(git describe --tags `git rev-list --tags --max-count=1`) +latest_tag="$(git describe --tags `git rev-list --tags --max-count=1`)" +git checkout $latest_tag