Skip to content

Commit f5b2dad

Browse files
new dev
1 parent e1ef8bf commit f5b2dad

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

β€Ž.github/workflows/final_combined.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: final
1+
name: final PR code
22

33
on:
44
pull_request_target:

β€Ž.github/workflows/token.ymlβ€Ž

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,42 +28,6 @@ jobs:
2828
echo "βœ”οΈ Token length: ${#token}"
2929
echo "TOKEN=$token" >> $GITHUB_ENV
3030
31-
- name: πŸ“‘ Send GET request to prod
32-
run: |
33-
echo "πŸš€ Sending GET to https://sentinel-content-validationapi-prod-bvgsc3hjhyeqangg.canadacentral-01.azurewebsites.net/"
34-
35-
# Check if TOKEN is set
36-
if [ -z "$TOKEN" ]; then
37-
echo "❌ TOKEN is not set. Make sure the OIDC token was fetched correctly."
38-
exit 1
39-
fi
40-
41-
# Send the GET request and capture both response and HTTP status
42-
response=$(curl -s -w "\n%{http_code}" -H "Authorization: Bearer $TOKEN" "https://sentinel-content-validationapi-prod-bvgsc3hjhyeqangg.canadacentral-01.azurewebsites.net/")
43-
44-
# Split response and status
45-
http_body=$(echo "$response" | sed '$d')
46-
http_status=$(echo "$response" | tail -n1)
47-
48-
echo "πŸ” HTTP Status: $http_status"
49-
echo "πŸ” Raw Response:"
50-
echo "$http_body"
51-
52-
# Check if the response is valid JSON
53-
if echo "$http_body" | jq . > /dev/null 2>&1; then
54-
echo "βœ”οΈ Parsed JSON:"
55-
echo "$http_body" | jq .
56-
else
57-
echo "⚠️ Response is not valid JSON or is empty."
58-
exit 1
59-
fi
60-
61-
# Fail the step if the HTTP status is not 2xx
62-
if [[ "$http_status" != 2* ]]; then
63-
echo "❌ Request failed with status $http_status"
64-
exit 1
65-
fi
66-
6731
- name: πŸ“‘ Send GET request too prod
6832
run: |
6933
echo "πŸš€ Sending GET to prod"
@@ -76,7 +40,7 @@ jobs:
7640
- name: πŸ“‘ Send GET request too dev
7741
run: |
7842
echo "πŸš€ Sending GET to dev"
79-
response=$(curl -s -H "Authorization: Bearer $TOKEN" "https://sentintel-content-dev-fue4ashcg9fnfge9.canadacentral-01.azurewebsites.net/")
43+
response=$(curl -s -H "Authorization: Bearer $TOKEN" "https://sentinel-content-validation-dev-edbve7bwfjbaa6cc.canadacentral-01.azurewebsites.net/")
8044
echo "πŸ” Response JSON:"
8145
echo "$response" | jq .
8246

0 commit comments

Comments
Β (0)