Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 03:15 UTC
fix: address audit findings in docs sync workflows
- Handle null SHA on force-push/first push in sdk-change-sync - Add error handling for empty/failed fetches in sync-connect-clients - Remove unnecessary id-token:write permission from both workflows - Write diff directly to file instead of shell variable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmitha Mallesh committed
Mar 13, 2026 at 17:55 UTC
59f5a0aae510fcd4a1e8103ab3efd54b740f9bf1
2 files changed
+19
-7
.github/workflows/docs.sdk-change-sync.yml
+9
-6
@@ -16,7 +16,6 @@ jobs:
16
permissions:
17
contents: write
18
pull-requests: write
19
- id-token: write
19
20
steps:
21
- name: Checkout repository
@@ -30,18 +29,22 @@ jobs:
29
BEFORE: ${{ github.event.before }}
30
AFTER: ${{ github.event.after }}
31
run: |
33
- DIFF=$(git diff "$BEFORE".."$AFTER" -- \
32
+ if [[ "$BEFORE" =~ ^0+$ ]]; then
33
+ echo "First push or force-push — diffing against HEAD~1"
34
+ BEFORE=$(git rev-parse HEAD~1)
35
+ fi
36
+
37
+ git diff "$BEFORE".."$AFTER" -- \
38
ts/packages/core/src/ \
39
ts/packages/cli/src/ \
40
ts/packages/providers/*/src/ \
37
- python/composio/)
41
+ python/composio/ > /tmp/sdk-diff.patch
42
39
- if [ -z "$DIFF" ]; then
43
+ if [ ! -s /tmp/sdk-diff.patch ]; then
44
echo "has_changes=false" >> $GITHUB_OUTPUT
45
else
46
echo "has_changes=true" >> $GITHUB_OUTPUT
43
- echo "$DIFF" > /tmp/sdk-diff.patch
44
- echo "$(echo "$DIFF" | wc -l) lines of SDK changes"
47
+ echo "$(wc -l < /tmp/sdk-diff.patch) lines of SDK changes"
48
fi
49
50
- name: Check docs for staleness
.github/workflows/docs.sync-connect-clients.yml
+10
-1
@@ -12,7 +12,6 @@ jobs:
12
permissions:
13
contents: write
14
pull-requests: write
15
- id-token: write
15
16
steps:
17
- name: Checkout repository
@@ -28,7 +27,12 @@ jobs:
27
DASHBOARD_TAG: ${{ github.event.client_payload.dashboard_tag }}
28
GH_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
29
run: |
30
+ set -e
31
if [ "$EVENT_NAME" = "repository_dispatch" ]; then
32
+ if [ -z "$CLIENT_DEFINITIONS" ]; then
33
+ echo "::error::repository_dispatch payload missing client_definitions"
34
+ exit 1
35
+ fi
36
echo "$CLIENT_DEFINITIONS" | base64 -d > /tmp/client-definitions.ts
37
echo "Received client-definitions.ts from dashboard deploy (tag: $DASHBOARD_TAG)"
38
else
@@ -37,6 +41,11 @@ jobs:
41
repos/ComposioHQ/composio_dashboard/contents/src/app/\(connect\)/\[org\]/~/connect/clients/_components/client-definitions.ts?ref=main \
42
--jq '.content' | base64 -d > /tmp/client-definitions.ts
43
fi
44
+
45
+ if [ ! -s /tmp/client-definitions.ts ]; then
46
+ echo "::error::client-definitions.ts is empty"
47
+ exit 1
48
+ fi
49
echo "$(wc -l < /tmp/client-definitions.ts) lines"
50
51
- name: Sync Connect clients