A GitHub Action to run VM0 agents in your CI/CD workflows.
- name: Run VM0 Agent
uses: vm0-ai/run-action@v1
with:
agent: my-agent
prompt: "Build and test the project"
artifact-name: my-artifact
vm0-token: ${{ secrets.VM0_TOKEN }}| Input | Required | Default | Description |
|---|---|---|---|
agent |
Yes | - | Agent name, ID, or name:version (e.g., my-agent, my-agent:abc123, my-agent:latest) |
prompt |
Yes | - | Prompt for the agent |
artifact-name |
Yes | - | Artifact storage name |
vars |
No | - | Variables for ${{ vars.xxx }} (KEY=value format, one per line) |
secrets |
No | - | Secrets for ${{ secrets.xxx }} (KEY=value format, one per line) |
verbose |
No | false |
Show verbose output with timing information |
vm0-token |
Yes | - | VM0 authentication token |
vm0-api-url |
No | https://www.vm0.ai |
VM0 API URL |
cli-version |
No | latest |
@vm0/cli version to install |
| Output | Description |
|---|---|
run-id |
The run ID |
session-id |
Agent session ID (for vm0 run continue) |
checkpoint-id |
Checkpoint ID (for vm0 run resume) |
conversation-id |
Conversation ID |
success |
Whether the run completed successfully (true or false) |
name: Run Agent
on: [push]
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Run VM0 Agent
uses: vm0-ai/run-action@v1
with:
agent: my-agent
prompt: "Hello, world!"
artifact-name: my-artifact
vm0-token: ${{ secrets.VM0_TOKEN }}- name: Run VM0 Agent
uses: vm0-ai/run-action@v1
with:
agent: my-agent
prompt: "Deploy the application"
artifact-name: my-artifact
vm0-token: ${{ secrets.VM0_TOKEN }}
vars: |
ENVIRONMENT=production
VERSION=${{ github.sha }}
secrets: |
API_KEY=${{ secrets.API_KEY }}
DATABASE_URL=${{ secrets.DATABASE_URL }}- name: Run VM0 Agent
uses: vm0-ai/run-action@v1
with:
agent: my-agent:abc12345
prompt: "Run with specific version"
artifact-name: my-artifact
vm0-token: ${{ secrets.VM0_TOKEN }}- name: Run VM0 Agent
id: vm0
uses: vm0-ai/run-action@v1
with:
agent: my-agent
prompt: "Build the project"
artifact-name: my-artifact
vm0-token: ${{ secrets.VM0_TOKEN }}
- name: Print Results
run: |
echo "Run ID: ${{ steps.vm0.outputs.run-id }}"
echo "Session ID: ${{ steps.vm0.outputs.session-id }}"
echo "Checkpoint ID: ${{ steps.vm0.outputs.checkpoint-id }}"
echo "Success: ${{ steps.vm0.outputs.success }}"- name: Run VM0 Agent
uses: vm0-ai/run-action@v1
with:
agent: my-agent
prompt: "Hello!"
artifact-name: my-artifact
vm0-token: ${{ secrets.VM0_TOKEN }}
vm0-api-url: https://custom.vm0.example.comname: Daily Agent Run
on:
schedule:
# Run every day at 9:00 AM UTC
- cron: '0 9 * * *'
workflow_dispatch: # Allow manual trigger
jobs:
daily-run:
runs-on: ubuntu-latest
steps:
- name: Run VM0 Agent
uses: vm0-ai/run-action@v1
with:
agent: my-agent
prompt: "Generate daily report and send notifications"
artifact-name: daily-reports
vm0-token: ${{ secrets.VM0_TOKEN }}To use this action, you need a VM0 authentication token. You can get one by:
- Install the VM0 CLI:
npm install -g @vm0/cli - Login:
vm0 auth login - Export token:
vm0 auth setup-token - Add to GitHub Secrets as
VM0_TOKEN
# Export token and add to GitHub secrets
vm0 auth setup-token | gh secret set VM0_TOKENMIT