Trigger a task from CI
Fire a Veirox task from a GitHub Actions workflow, attach an idempotency key so retries are deduplicated, and stream the transcript inline.
Prerequisites
- A Veirox task with a known
task-id(UUID). - An API key with
tasks:triggerscope stored as GitHub secretVEIROX_API_KEY. veiroxCLI installed on the runner (see install step below).
Steps
# .github/workflows/nightly.yml
name: Nightly agent run
on:
schedule: [{ cron: '0 2 * * *' }]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Install Veirox CLI
run: curl -fsSL https://veirox.com/cli/install.sh | sh
- name: Trigger task
run: |
veirox task run "$VEIROX_TASK_ID" --idempotency-key "$GITHUB_RUN_ID" --wait
env:
VEIROX_API_KEY: ${{ secrets.VEIROX_API_KEY }}
VEIROX_TASK_ID: ${{ vars.VEIROX_TASK_ID }}
Common pitfalls
- Job timeout: drop
--waitand stream in a separate step withtimeout-minutesif the task can be long-running. - API key scope: ensure the key has
tasks:trigger, not justtasks:read. - Project ID: set
VEIROX_PROJECT_IDif your org has more than one project.
See also
- ๐ Reference: veirox task
- ๐ Reference: veirox api-key
- ๐ Concept: Sessions