Skip to content

Commit cc10e1f

Browse files
authored
Fix/breardon2011/prevent not found curl (#2118)
* handle failed cli download * dummy url to test * check again * remove override
1 parent 25ce0e2 commit cc10e1f

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

action.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,16 +519,51 @@ runs:
519519
id: digger
520520
shell: bash
521521
run: |
522+
set -euo pipefail
523+
524+
echo "🔧 Downloading Digger CLI..."
525+
echo "Runner OS: ${{ runner.os }}, Arch: ${{ runner.arch }}, Action Ref: ${actionref}"
526+
522527
if [[ ${{ inputs.ee }} == "true" ]]; then
523528
if [[ ${{ inputs.fips }} == "true" ]]; then
524-
curl -sL https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }}-fips -o digger
529+
DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }}-fips"
525530
else
526-
curl -sL https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }} -o digger
531+
DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${actionref}/digger-ee-cli-${{ runner.os }}-${{ runner.arch }}"
527532
fi
528533
else
529-
curl -sL https://github.com/diggerhq/digger/releases/download/${actionref}/digger-cli-${{ runner.os }}-${{ runner.arch }} -o digger
534+
DOWNLOAD_URL="https://github.com/diggerhq/digger/releases/download/${actionref}/digger-cli-${{ runner.os }}-${{ runner.arch }}"
535+
fi
536+
537+
echo "Downloading from: $DOWNLOAD_URL"
538+
539+
if ! curl -sL --fail "$DOWNLOAD_URL" -o digger; then
540+
echo "Failed to download Digger CLI from $DOWNLOAD_URL"
541+
echo ""
542+
echo "Possible reasons:"
543+
echo "1. The release ${actionref} might not exist"
544+
echo "2. Binary for ${{ runner.os }}-${{ runner.arch }} might not be available"
545+
echo "3. Network connectivity issues"
546+
echo ""
547+
echo "Suggestions:"
548+
echo "- Check if release ${actionref} exists at: https://github.com/diggerhq/digger/releases"
549+
echo "- Verify the architecture combination is supported"
550+
echo "- Try using a different release version"
551+
exit 1
530552
fi
553+
554+
if [[ ! -f digger || ! -s digger ]]; then
555+
echo "Downloaded file is empty or doesn't exist"
556+
exit 1
557+
fi
558+
531559
chmod +x digger
560+
561+
if [[ ! -x digger ]]; then
562+
echo "Failed to make digger executable"
563+
exit 1
564+
fi
565+
566+
echo "Successfully downloaded and prepared Digger CLI"
532567
PATH=$PATH:$(pwd)
533568
cd $GITHUB_WORKSPACE
534569
digger

0 commit comments

Comments
 (0)