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 21, 19:45 UTC
chore(ci): add least-privilege tokens, fork-pr guards, audit gate (#3748)
This PR: - depends on #3751 (dependency fixes split out; **merge #3751 first** or the new audit gate below is red) - adds top-level `permissions: contents: read` to the 23 workflows missing one, with job-level opt-ups only where jobs demonstrably need writes (releases, docs automation PR creation, audit PR comments); the `security.secrets-detection.yml` caller job mirrors the reusable workflow's declared scopes so the secret-scanning check keeps working under the cap - pins the secrets-detection reusable-workflow ref to ComposioHQ/.github@a6c053d (master, post ComposioHQ/.github#12) whose actions are now SHA-pinned, fixing the `startup_failure` every PR was hitting - guards all four E2E jobs in `ts.test-e2e.yml` so dependabot and fork PRs (which get no secrets) skip secret-backed steps with a `::notice` instead of failing red; install/build and the secret-free CLI docker build still run on fork PRs - makes `pnpm audit --prod --audit-level=high` a hard gate in `ts.audit.yml` (the advisory PR-comment flow is unchanged) and adds root `package.json`/`pnpm-lock.yaml`/`pnpm-workspace.yaml` to the audit triggers so manifest-only changes can't bypass it - drops the orphaned job-level `pull-requests: write` from `ts.test.yml` (no step has used the PR API since the #2212 comment step was removed) ## Context Implements `plans/002-ci-hardening-permissions-and-fork-guards.md` (advisor plan, orthogonal to the SDK v1 roadmap). A hard `pnpm audit` gate was tried once before and reverted for blocking unrelated PRs (#2213, `dec0ced78`); it lands now paired with #3751, which clears the high advisories, and it only fails on high/critical advisories in production dependencies. Reviewer notes: - release workflows verified statically: `py.release` publishes via PyPI credentials (no token writes); `ts.release` does all writes via the minted GitHub App token and keeps `id-token: write` - worth a dry run after merge: one fork PR to confirm the four skip notices, and one same-repo Secrets Detection run to confirm no 403 warning (the run on this PR already passed clean) - known follow-ups (deliberately out of scope): dev-dependency high advisories (gate is `--prod`), a scheduled audit run, encoding the permissions convention in `.agents/skills/repo-guidance`, extracting the duplicated guard into a composite action