Skip to content

Commit df41f2d

Browse files
test: adj validator
1 parent c83ea74 commit df41f2d

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/adj-tester.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: ADJ Validator
22

33
on:
4-
push:
4+
push:
55
pull_request:
66

77
jobs:
@@ -23,5 +23,26 @@ jobs:
2323
pip install jsonschema
2424
2525
- name: Run ADJ validation
26+
id: adj_validation
2627
run: |
27-
python3 .github/workflows/scripts/adj-tester/main.py
28+
set +e
29+
python3 .github/workflows/scripts/adj-tester/main.py 2> error.log
30+
EXIT_CODE=$?
31+
echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT
32+
exit $EXIT_CODE
33+
34+
- name: Send Slack notification if failed
35+
if: failure()
36+
run: |
37+
ERROR_MESSAGE=$(cat error.log)
38+
39+
curl -X POST -H 'Content-type: application/json' \
40+
--data "{
41+
\"text\": \"❌ *ADJ Validator Failed* \n
42+
Repository: ${{ github.repository }} \n
43+
Branch: ${{ github.ref_name }} \n
44+
Actor: ${{ github.actor }} \n
45+
Commit: ${{ github.sha }} \n
46+
Error:\n\`\`\`$ERROR_MESSAGE\`\`\`\"
47+
}" \
48+
${{ secrets.SLACK_WEBHOOK_URL }}

0 commit comments

Comments
 (0)