Skip to content

vm0-ai/run-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

VM0 Run Action

A GitHub Action to run VM0 agents in your CI/CD workflows.

Usage

- 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 }}

Inputs

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

Outputs

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)

Examples

Basic Usage

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 }}

With Variables and Secrets

- 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 }}

Using Specific Agent Version

- 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 }}

Using Outputs

- 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 }}"

With Custom API URL

- 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.com

Scheduled Task (Cron)

name: 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 }}

Authentication

To use this action, you need a VM0 authentication token. You can get one by:

  1. Install the VM0 CLI: npm install -g @vm0/cli
  2. Login: vm0 auth login
  3. Export token: vm0 auth setup-token
  4. Add to GitHub Secrets as VM0_TOKEN
# Export token and add to GitHub secrets
vm0 auth setup-token | gh secret set VM0_TOKEN

License

MIT

About

GitHub Action to run VM0 agents in CI/CD workflows

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •