File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,12 +34,20 @@ steps:
3434 fi
3535 echo "Release branch detected. Fetching PR data from GitHub API..."
3636
37- # Fetch PR data using curl approach
38- PR_DATA =$(curl -s -H "Authorization: token $$GITHUB_TOKEN" \
37+ # Fetch PR data and status code
38+ HTTP_STATUS =$(curl -s -o pr_data.json -w "%{http_code}" -H "Authorization: token $$GITHUB_TOKEN" \
3939 "https://api.github.com/repos/$REPO_FULL_NAME/pulls/$_PR_NUMBER")
4040
41+ if [ "$$HTTP_STATUS" -ne 200 ]; then
42+ echo "Error fetching PR data: HTTP $$HTTP_STATUS"
43+ cat pr_data.json
44+ exit 1
45+ fi
46+
47+ PR_DATA=$(cat pr_data.json)
48+
4149 # Extract labels and title from PR data (Use $$ to escape bash variables)
42- PR_LABELS=$(echo "$$PR_DATA" | jq -r '.labels[].name' | paste -sd ', ')
50+ PR_LABELS=$(echo "$$PR_DATA" | jq -r '[ .labels[].name] | join(",") ')
4351 PR_TITLE=$(echo "$$PR_DATA" | jq -r '.title')
4452
4553 # Determine Release Version (Use double quotes and $$ for bash variables)
@@ -86,4 +94,4 @@ availableSecrets:
8694 - versionName : projects/$PROJECT_ID/secrets/daily-ci-evals-db-password/versions/latest
8795 env : ' DB_PASSWORD'
8896 - versionName : projects/$PROJECT_ID/secrets/GITHUB_TOKEN/versions/latest
89- env : ' GITHUB_TOKEN'
97+ env : ' GITHUB_TOKEN'
You can’t perform that action at this time.
0 commit comments