From 30b33021d9e1d722768725f0e5a53757b663bee4 Mon Sep 17 00:00:00 2001 From: Maxim Devoir Date: Thu, 2 Jan 2020 14:30:31 -0800 Subject: [PATCH] ci: publish docs (#1101) * fix: use Bash for script Using `/bin/sh` lead to multiple warnings that could result in errors in some POSIX environments. See [SC2039](https://github.com/koalaman/shellcheck/wiki/SC2039). * In POSIX sh, [[ ]] is undefined.shellcheck(SC2039) * In POSIX sh, string replacement is undefined.shellcheck(SC2039) * Using /bin/sh leads to authentication errors for my CI | https://travis-ci.org/MaximDevoir/probot/builds/631990067 * fix: get latest tag for `VERSION` Previous commit would retrieve an older tag --- script/publish-docs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/publish-docs b/script/publish-docs index 3c44507f..30600d8f 100755 --- a/script/publish-docs +++ b/script/publish-docs @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash # Exit if a command returns a non-zero code set -e # Store the versions -VERSION=$(git describe --tags "$(git rev-list --tags='v[0-9]*' --max-count=1)" | sed 's/^v//') +VERSION=$(git describe --tags --match "v[0-9]*" --abbrev=0 | sed 's/^v//') HEAD=$(git rev-parse HEAD) # Generate docs