From 114eef3752649d7be19e94299d647361ffab75ea Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 10 Aug 2023 06:26:57 +0200 Subject: [PATCH] Update branch existence check in gcodeanalyzer workflow Added quotes around the curl URL for better error handling and added echo statements for better debugging by specifying whether 'branch_name' or 'main' is getting used. Quoting the curl URL helps prevent potential issues with special characters in branch names. The echo statements help in understanding workflow logs by indicating which branch is being used. --- .github/workflows/gcodeanalyzer.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gcodeanalyzer.yml b/.github/workflows/gcodeanalyzer.yml index 67b80f529f..ccf95b321a 100644 --- a/.github/workflows/gcodeanalyzer.yml +++ b/.github/workflows/gcodeanalyzer.yml @@ -87,7 +87,7 @@ jobs: run: | cd CuraEngine branch_name=$(git rev-parse --abbrev-ref HEAD) - exists=$(curl -s -o /dev/null -w "%{http_code}" https://api.github.com/repos/ultimaker/cura/branches/${branch_name}) + exists=$(curl -s -o /dev/null -w "%{http_code}" "https://api.github.com/repos/ultimaker/cura/branches/${branch_name}") cd .. mkdir Cura cd Cura @@ -95,8 +95,10 @@ jobs: git sparse-checkout set resources/definitions resources/extruders git remote add -f origin https://github.com/Ultimaker/Cura if [ "$exists" == "200" ]; then + echo "Using '${branch_name}' for Cura" >> $GITHUB_STEP_SUMMARY git pull origin ${branch_name} else + echo "Using 'main' for Cura" >> $GITHUB_STEP_SUMMARY git pull origin main fi cd ..