From 0364e4b90ee232b32c2e8c5b83dea7df7c3b4d0f Mon Sep 17 00:00:00 2001 From: Marcel <46164444+MSt-10@users.noreply.github.com> Date: Mon, 11 Mar 2024 10:29:51 +0100 Subject: [PATCH] Update action.yml --- action.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 80c07840..e312d55f 100644 --- a/action.yml +++ b/action.yml @@ -115,12 +115,26 @@ runs: if: env.action_version == 'main' shell: bash run: | - curl -s ${{ github.api_url }}/repos/PalladioSimulator/Palladio-ReverseEngineering-Retriever/releases/latest \ - | grep -E 'browser_download_url' \ - | grep linux \ - | grep x86_64 \ - | grep -Eo 'https://[^\"]*' \ - | xargs wget -O "${{ env.tmp_dir }}/retriever.zip" + + # Execute the curl command and save its output to a variable + output=$(curl -s https://api.github.com/repos/PalladioSimulator/Palladio-ReverseEngineering-Retriever/releases/latest) + + # Check if the output contains 'browser_download_url'. If not, print a warning and the output. + echo "$output" | grep 'browser_download_url' > /dev/null + if [ $? -ne 0 ]; then + echo "Warning: 'browser_download_url' not found in the curl command output." + echo "Curl command output:" + echo "$output" + exit 1 + else + # If 'browser_download_url' is found, proceed with the rest of the commands. + echo "$output" | grep -E 'browser_download_url' \ + | grep linux \ + | grep x86_64 \ + | grep -Eo 'https://[^\"]*' \ + | xargs wget -O "${{ env.tmp_dir }}/retriever.zip" + fi + - name: Download Retriever if: env.action_version != 'main'