Skip to content

Commit

Permalink
fix: print response output in case of curl failure
Browse files Browse the repository at this point in the history
  • Loading branch information
mtardy committed Jul 10, 2023
1 parent b95730f commit d21fc59
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ runs:
retry_delay=1
while [ -z "$version" ] && [ "$attempt" -le "$max_attempts" ]; do
echo "Attempt $attempt: Fetching latest version from GitHub..."
version=$(curl -s https://api.github.com/repos/libbpf/bpftool/releases/latest | jq -r '.tag_name | select (.!=null)')
response=$(curl -s https://api.github.com/repos/libbpf/bpftool/releases/latest)
version=$(echo $response | jq -r '.tag_name | select (.!=null)')
if [ -z "$version" ]; then
delay=$((2 ** (attempt - 1) * retry_delay))
echo -e "$response\n"
echo "Fetching latest version from GitHub failed. Retrying in $delay seconds..."
sleep "$delay"
fi
Expand Down

0 comments on commit d21fc59

Please sign in to comment.