From d33e65ea149f6566927dadfaa924bf850afeddbd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 15:56:39 +0000 Subject: [PATCH 1/2] Initial plan From 51d6f372cf81883ef9b0e60bf5f031efc26233b1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 16:00:12 +0000 Subject: [PATCH 2/2] IONOS(ci): add error handling for job URL API calls in build-artifact workflow Co-authored-by: printminion-co <145785698+printminion-co@users.noreply.github.com> --- .github/workflows/build-artifact.yml | 44 ++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-artifact.yml b/.github/workflows/build-artifact.yml index 62be8b28c4666..dbbc55fe5a626 100644 --- a/.github/workflows/build-artifact.yml +++ b/.github/workflows/build-artifact.yml @@ -306,10 +306,26 @@ jobs: id: get_job_url run: | # Fetch the numeric job ID from GitHub API - JOB_URL=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \ + API_RESPONSE=$(curl -s -w "\n%{http_code}" -H "Authorization: Bearer ${{ github.token }}" \ -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" \ - | jq -r '.jobs[] | select(.name == "build-external-apps (${{ matrix.app_info.name }})") | .html_url') + "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs") + + HTTP_CODE=$(echo "$API_RESPONSE" | tail -n1) + RESPONSE_BODY=$(echo "$API_RESPONSE" | sed '$d') + + if [ "$HTTP_CODE" != "200" ]; then + echo "❌ ERROR: GitHub API request failed with HTTP code $HTTP_CODE" + exit 1 + fi + + JOB_URL=$(echo "$RESPONSE_BODY" | jq -r '.jobs[] | select(.name == "build-external-apps (${{ matrix.app_info.name }})") | .html_url') + + if [ -z "$JOB_URL" ] || [ "$JOB_URL" = "null" ]; then + echo "❌ ERROR: Failed to extract job URL from API response" + echo "Response body: $RESPONSE_BODY" + exit 1 + fi + echo "job_html_url=$JOB_URL" >> $GITHUB_OUTPUT echo "Job URL: $JOB_URL" @@ -703,10 +719,26 @@ jobs: id: get_job_url run: | # Fetch the numeric job ID from GitHub API - JOB_URL=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \ + API_RESPONSE=$(curl -s -w "\n%{http_code}" -H "Authorization: Bearer ${{ github.token }}" \ -H "Accept: application/vnd.github+json" \ - "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" \ - | jq -r '.jobs[] | select(.name == "Push to artifactory") | .html_url') + "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs") + + HTTP_CODE=$(echo "$API_RESPONSE" | tail -n1) + RESPONSE_BODY=$(echo "$API_RESPONSE" | sed '$d') + + if [ "$HTTP_CODE" != "200" ]; then + echo "❌ ERROR: GitHub API request failed with HTTP code $HTTP_CODE" + exit 1 + fi + + JOB_URL=$(echo "$RESPONSE_BODY" | jq -r '.jobs[] | select(.name == "Push to artifactory") | .html_url') + + if [ -z "$JOB_URL" ] || [ "$JOB_URL" = "null" ]; then + echo "❌ ERROR: Failed to extract job URL from API response" + echo "Response body: $RESPONSE_BODY" + exit 1 + fi + echo "job_html_url=$JOB_URL" >> $GITHUB_OUTPUT echo "Job URL: $JOB_URL"