Skip to content

Commit c47e893

Browse files
fix: correct bash variable escaping and comparison syntax in cloudbuild.yaml
1 parent 1464f73 commit c47e893

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

cloudbuild.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ steps:
3838
PR_DATA=$(curl -s -H "Authorization: token $$GITHUB_TOKEN" \
3939
"https://api.github.com/repos/$REPO_FULL_NAME/pulls/$_PR_NUMBER")
4040
41-
# Extract labels and title from PR data
42-
PR_LABELS=$(echo "$PR_DATA" | jq -r '.labels[].name' | paste -sd ',')
43-
PR_TITLE=$(echo "$PR_DATA" | jq -r '.title')
41+
# Extract labels and title from PR data (Use $$ to escape bash variables)
42+
PR_LABELS=$(echo "$$PR_DATA" | jq -r '.labels[].name' | paste -sd ',')
43+
PR_TITLE=$(echo "$$PR_DATA" | jq -r '.title')
4444
45-
# Determine Release Version
46-
if [[ '$PR_LABELS' =~ 'autorelease: triggered' ]]; then
47-
if [[ '$PR_TITLE' =~ release\ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
45+
# Determine Release Version (Use double quotes and $$ for bash variables)
46+
if [[ "$$PR_LABELS" == *"autorelease: triggered"* ]]; then
47+
if [[ "$$PR_TITLE" =~ release\ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
4848
export RELEASE_VERSION="$${BASH_REMATCH[1]}"
4949
else
5050
export RELEASE_VERSION="unknown"

0 commit comments

Comments
 (0)