summaryrefslogtreecommitdiffhomepage
path: root/tools/go_branch.sh
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-05-18 14:34:49 -0700
committergVisor bot <gvisor-bot@google.com>2020-05-18 14:36:16 -0700
commitcbfb55869e4d00ddd1ede096ba01adf2713e08b1 (patch)
tree18893f312a59241ec1ea14ebf5e7a12d6319eaf8 /tools/go_branch.sh
parent20e6efd302746554c485028f9fc1f2fbf88b234e (diff)
Implement Go branch updater with GitHub actions.
PiperOrigin-RevId: 312155686
Diffstat (limited to 'tools/go_branch.sh')
-rwxr-xr-xtools/go_branch.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/go_branch.sh b/tools/go_branch.sh
index f97a74aaf..e568a0a76 100755
--- a/tools/go_branch.sh
+++ b/tools/go_branch.sh
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-set -eo pipefail
+set -xeo pipefail
# Discovery the package name from the go.mod file.
declare -r module=$(cat go.mod | grep -E "^module" | cut -d' ' -f2)
@@ -42,7 +42,8 @@ declare -r head=$(git describe --always)
# We expect to have an existing go branch that we will use as the basis for
# this commit. That branch may be empty, but it must exist.
-declare -r go_branch=$(git show-ref --hash origin/go)
+git fetch --all
+declare -r go_branch=$(git show-ref --hash go)
# Clone the current repository to the temporary directory, and check out the
# current go_branch directory. We move to the new repository for convenience.