Skip to content

Commit 02b42e6

Browse files
Merge pull request #52 from step-security/Raj-StepSecurity-patch-9
feat: validate updated subscriptio check
2 parents 9d698a7 + 43110e7 commit 02b42e6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

entrypoint.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ API_URL="https://agent.api.stepsecurity.io/v1/github/$GITHUB_REPOSITORY/actions/
77
RESPONSE=$(curl --max-time 3 -s -w "%{http_code}" "$API_URL" -o /dev/null) || true
88
CURL_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+
if [ $CURL_EXIT_CODE -ne 0 ]; then
11+
echo "Timeout or API not reachable. Continuing to next step."
12+
elif [ "$RESPONSE" = "200" ]; then
13+
:
14+
elif [ "$RESPONSE" = "403" ]; then
15+
echo "Subscription is not valid. Reach out to support@stepsecurity.io"
16+
exit 1
17+
else
18+
echo "Timeout or API not reachable. Continuing to next step."
1819
fi
1920

2021
cd "${GITHUB_WORKSPACE}" || exit 1

0 commit comments

Comments
 (0)