Skip to content

Commit c43bedb

Browse files
committed
Update singleTenant_deploy_and_Integration_test_LatestVersion.yml
1 parent f6af68b commit c43bedb

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

.github/workflows/singleTenant_deploy_and_Integration_test_LatestVersion.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -234,40 +234,41 @@ jobs:
234234
-o "$CF_ORG" \
235235
-s "$CF_SPACE" > /dev/null
236236
237-
- name: Fetch and Escape Client Secret
238-
id: fetch_secret
237+
- name: Fetch and Escape Client Details for single tenant 🔍
238+
id: fetch_credentials
239239
run: |
240-
# Fetch the service instance GUID
240+
echo "🔄 Fetching client details for single tenant..."
241241
service_instance_guid=$(cf service demoappjava-public-uaa --guid)
242242
if [ -z "$service_instance_guid" ]; then
243-
echo "Error: Unable to retrieve service instance GUID"; exit 1;
243+
echo "Error: Unable to retrieve service instance GUID"; exit 1;
244244
fi
245-
# Fetch the binding GUID
246245
bindings_response=$(cf curl "/v3/service_credential_bindings?service_instance_guids=${service_instance_guid}")
247-
248-
binding_guid=$(echo $bindings_response | jq -r '.resources[0].guid')
246+
binding_guid=$(echo "$bindings_response" | jq -r '.resources[0].guid')
249247
if [ -z "$binding_guid" ]; then
250-
echo "Error: Unable to retrieve binding GUID"; exit 1;
248+
echo "Error: Unable to retrieve binding GUID"; exit 1;
251249
fi
252-
253-
# Fetch the clientSecret
254250
binding_details=$(cf curl "/v3/service_credential_bindings/${binding_guid}/details")
255251
clientSecret=$(echo "$binding_details" | jq -r '.credentials.clientsecret')
256252
if [ -z "$clientSecret" ] || [ "$clientSecret" == "null" ]; then
257-
echo "Error: clientSecret is not set or is null"; exit 1;
253+
echo "Error: clientSecret is not set or is null"; exit 1;
258254
fi
259-
260-
# Escape any $ characters in the clientSecret
261255
escapedClientSecret=$(echo "$clientSecret" | sed 's/\$/\\$/g')
262256
echo "::add-mask::$escapedClientSecret"
257+
clientID=$(echo "$binding_details" | jq -r '.credentials.clientid')
258+
if [ -z "$clientID" ] || [ "$clientID" == "null" ]; then
259+
echo "❌ Error: clientID is not set or is null"; exit 1;
260+
fi
261+
echo "::add-mask::$clientID"
263262
echo "CLIENT_SECRET=$escapedClientSecret" >> $GITHUB_OUTPUT
263+
echo "CLIENT_ID=$clientID" >> $GITHUB_OUTPUT
264+
echo "✅ Client details fetched successfully!"
264265
- name: Run integration tests (${{ matrix.tokenFlow }} - ${{ matrix.testClass }})
265266
env:
266-
CLIENT_SECRET: ${{ steps.fetch_secret.outputs.CLIENT_SECRET }}
267+
CLIENT_SECRET: ${{ steps.fetch_credentials.outputs.CLIENT_SECRET }}
268+
CLIENT_ID: ${{ steps.fetch_credentials.outputs.CLIENT_ID }}
267269
CF_ORG: ${{ secrets.CF_ORG }}
268270
CF_SPACE: ${{ secrets.CF_SPACE }}
269271
CAPAUTH_URL: ${{ secrets.CAPAUTH_URL }}
270-
CAPSDM_CLIENT_ID: ${{ secrets.CAPSDM_CLIENT_ID }}
271272
CF_USER: ${{ secrets.CF_USER }}
272273
CF_PASSWORD: ${{ secrets.CF_PASSWORD }}
273274
NOSDMROLEUSERNAME: ${{ secrets.NOSDMROLEUSERNAME }}
@@ -280,7 +281,7 @@ jobs:
280281
# Gather secrets and other values
281282
appUrl="$CF_ORG-$CF_SPACE-demoappjava-srv.cfapps.eu12.hana.ondemand.com"
282283
authUrl="$CAPAUTH_URL"
283-
clientID="$CAPSDM_CLIENT_ID"
284+
clientID="$CLIENT_ID"
284285
clientSecret="$CLIENT_SECRET"
285286
username="$CF_USER"
286287
password="$CF_PASSWORD"

0 commit comments

Comments
 (0)