Skip to content

Commit 55f21bf

Browse files
author
baton-admin[bot]
committed
chore: update CI workflows via baton-admin
1 parent f1f6ead commit 55f21bf

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

.github/workflows/generate-baton-metadata.yaml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,40 @@ jobs:
4040
message: "Updating baton capabilities."
4141
add: "baton_capabilities.json"
4242

43+
# On PR: verify committed JSON matches binary output
44+
- name: Verify committed metadata is up to date
45+
id: metadata-check
46+
if: github.event_name == 'pull_request'
47+
continue-on-error: true
48+
run: |
49+
CAPS_STALE=false
50+
CONFIG_STALE=false
51+
52+
if ! git diff --quiet -- baton_capabilities.json 2>/dev/null; then
53+
CAPS_STALE=true
54+
echo "::warning::baton_capabilities.json differs from binary output"
55+
git diff -- baton_capabilities.json
56+
fi
57+
58+
if [ "$CAPS_STALE" = "true" ] || [ "$CONFIG_STALE" = "true" ]; then
59+
echo ""
60+
echo "::error::The committed baton_capabilities.json and/or config_schema.json are out of date."
61+
echo "::error::The connector binary generates different metadata than what's committed."
62+
echo "::error::Run './connector capabilities > baton_capabilities.json' and './connector config > config_schema.json' locally, then commit the updated files."
63+
echo "::error::Or use the fix-ci-checks skill to update automatically."
64+
echo ""
65+
echo "Capabilities stale: $CAPS_STALE"
66+
echo "Config stale: $CONFIG_STALE"
67+
exit 1
68+
fi
69+
70+
echo "Committed metadata matches binary output."
71+
4372
# On PR: verify docs reflect current metadata
4473
- name: Verify docs match current metadata
45-
if: github.event_name == 'pull_request'
74+
id: docs-check
75+
if: github.event_name == 'pull_request' && always()
76+
continue-on-error: true
4677
run: |
4778
CAPS_CHANGED=false
4879
CONFIG_CHANGED=false
@@ -78,3 +109,12 @@ jobs:
78109
echo "Capabilities changed: $CAPS_CHANGED"
79110
echo "Config changed: $CONFIG_CHANGED"
80111
exit 1
112+
113+
# Fail the job if either PR check failed
114+
- name: Enforce PR check results
115+
if: github.event_name == 'pull_request' && always()
116+
run: |
117+
if [ "${{ steps.metadata-check.outcome }}" = "failure" ] || [ "${{ steps.docs-check.outcome }}" = "failure" ]; then
118+
echo "One or more PR checks failed. See above for details."
119+
exit 1
120+
fi

0 commit comments

Comments
 (0)