Skip to content

Commit

Permalink
Tag the full SHA not the short SHA
Browse files Browse the repository at this point in the history
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]: actions/checkout#265
[3]: https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays
  • Loading branch information
johnboyes authored Dec 4, 2021
1 parent 4842496 commit 2dce44c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/trunk-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 2dce44c

Please sign in to comment.