Skip to content

Commit e9f22f8

Browse files
chore(gha): monitor scheduled audit in betterstack
1 parent 89c45e1 commit e9f22f8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/_scheduled-audit.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,19 @@ jobs:
5353
5454
- name: Audit
5555
shell: bash
56-
run: make audit
56+
run: |
57+
set +e
58+
make audit
59+
EXIT_CODE=$?
60+
# Provide heartbeat to bettersqtack for monitoring/alerting if heartbeat url is configured as secret
61+
if [ -n "$BETTERSTACK_AUDIT_HEARTBEAT_URL" ]; then
62+
if [ $EXIT_CODE -eq 0 ]; then
63+
curl -s $BETTERSTACK_AUDIT_HEARTBEAT_URL
64+
else
65+
curl -s $BETTERSTACK_AUDIT_HEARTBEAT_URL/$EXIT_CODE
66+
fi
67+
fi
68+
exit $EXIT_CODE
5769
5870
- name: Upload test results
5971
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1

0 commit comments

Comments
 (0)