Skip to content

Commit

Permalink
use loop if JUST_VERSION is garbage
Browse files Browse the repository at this point in the history
  • Loading branch information
ledif committed Jan 5, 2025
1 parent 6f409ae commit 4a1926c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/shared/install-just.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
set -eoux pipefail
JUST_VERSION=$(curl --retry 3 --retry-all-errors -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
if [[ "${JUST_VERSION}" == "null" ]]; then
JUST_VERSION=1.38.0
fi
while [[ "${JUST_VERSION:-}" =~ null || -z "${JUST_VERSION:-}" ]]
do
JUST_VERSION=$(curl -L https://api.github.com/repos/casey/just/releases/latest | jq -r '.tag_name')
done
curl -sSLO https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz

Check warning on line 7 in .github/workflows/shared/install-just.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/shared/install-just.sh#L7

Double quote to prevent globbing and word splitting.
tar -zxvf just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz -C /tmp just

Check warning on line 8 in .github/workflows/shared/install-just.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/shared/install-just.sh#L8

Double quote to prevent globbing and word splitting.
sudo mv /tmp/just /usr/local/bin/just
Expand Down

0 comments on commit 4a1926c

Please sign in to comment.