-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add Cata dispatch workflow #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,58 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||
| name: Cata Agent Dispatch | |||||||||||||||||||||||||||||||||||||||||||||||||
| on: | |||||||||||||||||||||||||||||||||||||||||||||||||
| repository_dispatch: | |||||||||||||||||||||||||||||||||||||||||||||||||
| types: [octi-pulpo-dispatch] | |||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||
| cata-agent: | |||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |||||||||||||||||||||||||||||||||||||||||||||||||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 6 days ago In general, this problem is fixed by adding an explicit For this specific workflow, the only visible operations that rely on GitHub API access are: Concretely, edit permissions:
contents: readnear the top-level keys. No additional imports or tooling changes are required.
Suggested changeset
1
.github/workflows/cata-dispatch.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read |
Copilot
AI
Apr 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job can run for a long time (--max-turns 100) and can be dispatched repeatedly; consider adding timeout-minutes and a concurrency group (e.g., per TASK_ID or a single global group) to prevent runaway runs and reduce the chance of overlapping agents contending for the repo workspace/credentials.
| runs-on: ubuntu-latest | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| concurrency: | |
| group: cata-agent-${{ github.event.client_payload.task_id }} | |
| cancel-in-progress: true |
Copilot
AI
Apr 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow downloads and executes a prebuilt binary from another repo release without integrity verification. To reduce supply-chain risk, pin to a specific release version and verify a published checksum/signature before chmod/execution (or build from source within the workflow).
Copilot
AI
Apr 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./cata run ... || echo ... masks non-zero exit codes (including missing execute permission, runtime errors, or failed tasks), so the job can report success even when the agent fails. If downstream systems rely on workflow status, let this step fail (or capture the exit code and explicitly exit $code after logging) so job.status reflects the real outcome.
| "${TASK_PROMPT}" \ | |
| || echo "WARN: cata exited non-zero for task ${TASK_ID}" | |
| "${TASK_PROMPT}" | |
| cata_exit_code=$? | |
| if [ "$cata_exit_code" -ne 0 ]; then | |
| echo "WARN: cata exited non-zero for task ${TASK_ID}" | |
| exit "$cata_exit_code" | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository_dispatchwill run this workflow for any actor/token that can send that event to the repo. Since the payload includes an arbitrarypromptthat drives automation, add a verification gate (e.g., require a shared secret/HMAC inclient_payloadthat matches a repo secret, and/or restrictgithub.event.sender.login/actor allowlist) to prevent unauthorized dispatches from executing tasks with repo credentials.