From 2dce44ca9b092c3e357c5e447032d3f32592d509 Mon Sep 17 00:00:00 2001 From: John Boyes <154404+johnboyes@users.noreply.github.com> Date: Sat, 4 Dec 2021 20:40:35 +0000 Subject: [PATCH] Tag the full SHA not the short SHA GitHub's [Checkout action][1] needs the [full SHA in order to checkout a commit][2]. To get the full SHA we simply use a [bash array][3] which outputs its first element. [1]: https://github.com/actions/checkout [2]: https://github.com/actions/checkout/issues/265 [3]: https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays --- .github/workflows/trunk-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trunk-pipeline.yml b/.github/workflows/trunk-pipeline.yml index fff44e5..b760074 100644 --- a/.github/workflows/trunk-pipeline.yml +++ b/.github/workflows/trunk-pipeline.yml @@ -49,7 +49,7 @@ jobs: # as multiple commits can be linked to the same contract repo commit run: | CONTRACT_REPO=https://github.com/agilepathway/available-pets-consumer-contract - CONTRACT_HEAD=$(git ls-remote --heads $CONTRACT_REPO refs/heads/master | head -c 7) + CONTRACT_HEAD=($(git ls-remote --heads $CONTRACT_REPO refs/heads/master)) DATETIME=$(date '+%Y-%m-%d-%H-%M-%S') echo "::set-output name=contract-head::${CONTRACT_HEAD}-available-pets-consumer-contract-${DATETIME}"