File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,14 +7,16 @@ API_URL="https://agent.api.stepsecurity.io/v1/github/$GITHUB_REPOSITORY/actions/
77RESPONSE=$( curl --max-time 3 -s -w " %{http_code}" " $API_URL " -o /dev/null) || true
88CURL_EXIT_CODE=${?}
99
10- # Check if the response code is not 200
11- if [ " $CURL_EXIT_CODE " -ne 0 ] || [ " $RESPONSE " != " 200" ]; then
12- if [ -z " $RESPONSE " ] || [ " $RESPONSE " = " 000" ] || [ " $CURL_EXIT_CODE " -ne 0 ]; then
13- echo " Timeout or API not reachable. Continuing to next step."
14- else
15- echo " Subscription is not valid. Reach out to support@stepsecurity.io"
16- exit 1
17- fi
10+ # Decide based on curl exit code and HTTP status
11+ if [ $CURL_EXIT_CODE -ne 0 ]; then
12+ echo " Timeout or API not reachable. Continuing to next step."
13+ elif [ " $RESPONSE " = " 200" ]; then
14+ :
15+ elif [ " $RESPONSE " = " 403" ]; then
16+ echo " Subscription is not valid. Reach out to support@stepsecurity.io"
17+ exit 1
18+ else
19+ echo " Timeout or API not reachable. Continuing to next step."
1820fi
1921
2022# Copy the matcher to the host system; otherwise "add-matcher" can't find it.
You can’t perform that action at this time.
0 commit comments