@devries-cameron20 / composio-1 / commits / 32f547657
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

feat(ci): try auto-fixing "pnpm audit --prod" failures (#2213)

Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com> Co-authored-by: Musthaq Ahamad <53584487+haxzie@users.noreply.github.com> Co-authored-by: haxzie <musthu.gm@gmail.com>

Alberto Schiabel committed Dec 4, 2025 at 14:19 UTC 32f54765764aec5e408fbe2e9664e089498f573f
1 file changed +71
.github/workflows/ts.audit.yml new
+71
@@ -0,0 +1,71 @@
1 +name: Audit Typescript SDK
2 +
3 +on:
4 + push:
5 + branches: [main, next]
6 + paths:
7 + - "ts/**"
8 + pull_request:
9 + branches: [main, next]
10 + paths:
11 + - "ts/**"
12 +
13 +jobs:
14 + audit:
15 + name: Audit
16 + runs-on: ubuntu-latest
17 + permissions:
18 + pull-requests: write
19 +
20 + steps:
21 + - name: Checkout Code
22 + uses: actions/checkout@v3
23 +
24 + - name: Setup PNPM
25 + uses: pnpm/action-setup@v4
26 +
27 + - name: Set up Node.js
28 + uses: actions/setup-node@v3
29 + with:
30 + node-version: "20"
31 + cache: "pnpm"
32 +
33 + - name: Run pnpm audit (production dependencies only)
34 + id: audit
35 + continue-on-error: true
36 + run: pnpm audit --prod > audit-output.txt 2>&1
37 +
38 + - name: Comment on PR if audit failed
39 + if: steps.audit.outcome == 'failure' && github.event_name == 'pull_request'
40 + run: |
41 + {
42 + echo "⚠️ **Security Audit Failed**"
43 + echo ""
44 + echo "The \`pnpm audit --prod\` check found security vulnerabilities in production dependencies."
45 + echo ""
46 + echo "Please review and fix the vulnerabilities. You can try running:"
47 + echo "\`\`\`bash"
48 + echo "pnpm audit --fix --prod"
49 + echo "\`\`\`"
50 + echo ""
51 + echo "<details>"
52 + echo "<summary>Audit output</summary>"
53 + echo ""
54 + echo "\`\`\`"
55 + cat audit-output.txt
56 + echo "\`\`\`"
57 + echo ""
58 + echo "</details>"
59 + } > audit-comment.txt
60 +
61 + - name: Post audit comment to PR
62 + if: steps.audit.outcome == 'failure' && github.event_name == 'pull_request'
63 + uses: thollander/actions-comment-pull-request@v3.0.1
64 + with:
65 + file-path: audit-comment.txt
66 +
67 + - name: Fail if audit failed (push events)
68 + if: steps.audit.outcome == 'failure' && github.event_name == 'push'
69 + run: |
70 + echo "Security vulnerabilities found in production dependencies. Please fix them before merging."
71 + exit 1