Skip to content

Commit e3aa029

Browse files
committed
fix: URL-encode pipeline UUID for Bitbucket API calls
1 parent 096434c commit e3aa029

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

actions/k8s-deploy/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,12 @@ runs:
7777
fi
7878
7979
PIPELINE_UUID=$(echo "$BODY" | jq -r '.uuid')
80+
# URL-encode the curly braces in UUID for API calls
81+
PIPELINE_UUID_ENCODED=$(echo "$PIPELINE_UUID" | sed 's/{/%7B/g; s/}/%7D/g')
8082
PIPELINE_URL="https://bitbucket.org/landcareresearch/k8s-apps-config/pipelines/results/${PIPELINE_UUID}"
8183
8284
echo "pipeline_uuid=$PIPELINE_UUID" >> $GITHUB_OUTPUT
85+
echo "pipeline_uuid_encoded=$PIPELINE_UUID_ENCODED" >> $GITHUB_OUTPUT
8386
echo "pipeline_url=$PIPELINE_URL" >> $GITHUB_OUTPUT
8487
8588
echo "✅ Pipeline triggered: $PIPELINE_URL"
@@ -92,15 +95,16 @@ runs:
9295
run: |
9396
echo "::group::Waiting for pipeline completion"
9497
95-
PIPELINE_UUID="${{ steps.trigger.outputs.pipeline_uuid }}"
98+
# Use URL-encoded UUID for API calls
99+
PIPELINE_UUID_ENCODED="${{ steps.trigger.outputs.pipeline_uuid_encoded }}"
96100
TIMEOUT=${{ inputs.timeout }}
97101
ELAPSED=0
98102
POLL_INTERVAL=10
99103
100104
while [[ $ELAPSED -lt $TIMEOUT ]]; do
101105
RESPONSE=$(curl -s \
102106
-H "Authorization: Bearer ${{ inputs.bitbucket_token }}" \
103-
"https://api.bitbucket.org/2.0/repositories/landcareresearch/k8s-apps-config/pipelines/${PIPELINE_UUID}")
107+
"https://api.bitbucket.org/2.0/repositories/landcareresearch/k8s-apps-config/pipelines/${PIPELINE_UUID_ENCODED}")
104108
105109
STATE=$(echo "$RESPONSE" | jq -r '.state.name')
106110
RESULT=$(echo "$RESPONSE" | jq -r '.state.result.name // empty')

0 commit comments

Comments
 (0)