File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,16 +15,18 @@ API_URL="https://agent.api.stepsecurity.io/v1/github/$GITHUB_REPOSITORY/actions/
1515
1616# Set a timeout for the curl command (3 seconds)
1717RESPONSE=$( curl --max-time 3 -s -w " %{http_code}" " $API_URL " -o /dev/null) || true
18- CURL_EXIT_CODE=${?}
19-
20- # Check if the response code is not 200
21- if [ $CURL_EXIT_CODE -ne 0 ] || [ " $RESPONSE " != " 200" ]; then
22- if [ -z " $RESPONSE " ] || [ " $RESPONSE " == " 000" ] || [ $CURL_EXIT_CODE -ne 0 ]; then
23- echo " Timeout or API not reachable. Continuing to next step."
24- else
25- echo " Subscription is not valid. Reach out to support@stepsecurity.io"
26- exit 1
27- fi
18+ CURL_EXIT_CODE=$?
19+
20+ # Decide based on curl exit code and HTTP status
21+ if [ $CURL_EXIT_CODE -ne 0 ]; then
22+ echo " Timeout or API not reachable. Continuing to next step."
23+ elif [ " $RESPONSE " = " 200" ]; then
24+ :
25+ elif [ " $RESPONSE " = " 403" ]; then
26+ echo " Subscription is not valid. Reach out to support@stepsecurity.io"
27+ exit 1
28+ else
29+ echo " Timeout or API not reachable. Continuing to next step."
2830fi
2931
3032# `mongosh` is used starting from MongoDB 5.x
You can’t perform that action at this time.
0 commit comments