Skip to content

streetrace-ai/github-action

Repository files navigation

Streetrace GitHub Action

Run Streetrace agents in your CI/CD pipeline to automate code reviews, testing, and analysis.

Features

  • 🚀 Download and execute Streetrace agents
  • 💬 Automatic PR comments with agent output
  • 🔧 Easy integration with existing workflows
  • 🔒 Secure API key handling

Usage

Basic Setup

name: Streetrace CI
on: [push, pull_request]

jobs:
  streetrace:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run Streetrace Agent
        uses: streetrace-ai/github-action@v1
        with:
          claims: |
            agent_name: "myagent@v2"
            recipe: "code_review@v1"
        env:
          STREETRACE_API_KEY: ${{ secrets.STREETRACE_API_KEY }}
          STREETRACE_API_URL: ${{ secrets.STREETRACE_API_URL }}

Inputs

Input Description Required Default
claims YAML key-value pairs for configuring the agent Yes -
prompt Optional prompt to pass to the Streetrace agent No -

Environment Variables

All environment variables specified in the workflow's env field are passed to the Streetrace binary. This includes both required Streetrace configuration and any custom variables your agent needs.

Required Variables:

Variable Description Required Default
STREETRACE_API_KEY Streetrace API Key for authentication Yes -
STREETRACE_API_URL URL of the Streetrace API No https://api.streetrace.ai/

Custom Variables:

You can pass any additional environment variables (like repository secrets) to your Streetrace agent by including them in the env field alongside the required variables.

Claims

Currently supported claims:

Claim Description Required
agent_name Name and version of the agent (e.g., myagent@v2) Yes

Outputs

Output Description
result The output from the Streetrace agent execution

Pull Request Comments

When running on pull requests, the action automatically posts the agent output as a comment. To enable this feature, ensure your workflow has write permissions:

permissions:
  contents: read
  pull-requests: write

Examples

Custom API URL

- uses: streetrace-ai/github-action@v1
  with:
    claims: |
      agent_name: "codereview@v1"
  env:
    STREETRACE_API_KEY: ${{ secrets.STREETRACE_API_KEY }}
    STREETRACE_API_URL: 'https://custom.streetrace.example.com/'

Using Output in Subsequent Steps

- uses: streetrace-ai/github-action@v1
  id: streetrace
  with:
    claims: |
      agent_name: "analyzer@v2"
  env:
    STREETRACE_API_KEY: ${{ secrets.STREETRACE_API_KEY }}

- name: Process Results
  run: |
    echo "Agent output:"
    echo "${{ steps.streetrace.outputs.result }}"

Multiple Claims

- uses: streetrace-ai/github-action@v1
  with:
    claims: |
      agent_name: "security_scanner@v3"
      recipe: "vulnerability_scan@v1"
      severity_threshold: "high"
  env:
    STREETRACE_API_KEY: ${{ secrets.STREETRACE_API_KEY }}

Passing Custom Environment Variables

Pass repository secrets or other environment variables to the Streetrace agent using the standard env field:

- uses: streetrace-ai/github-action@v1
  with:
    claims: |
      agent_name: "deployment@v1"
  env:
    # Required Streetrace variables
    STREETRACE_API_KEY: ${{ secrets.STREETRACE_API_KEY }}
    # Custom variables for your agent
    DATABASE_URL: ${{ secrets.DATABASE_URL }}
    API_TOKEN: ${{ secrets.API_TOKEN }}
    ENVIRONMENT: production

Custom Prompt

Override the default prompt:

- uses: streetrace-ai/github-action@v1
  with:
    claims: |
      agent_name: "analyzer@v2"
    prompt: 'Focus on security vulnerabilities in the authentication module'
  env:
    STREETRACE_API_KEY: ${{ secrets.STREETRACE_API_KEY }}

Setup

  1. Get your Streetrace API key from streetrace.ai
  2. Add it as a secret in your GitHub repository (Settings → Secrets → Actions)
  3. Create your agent in the Streetrace platform
  4. Add this action to your workflow

Requirements

  • Node.js 20.x runtime (handled automatically by GitHub Actions)
  • Python 3.x (for pipx and streetrace CLI installation)

Testing

Manual Testing via GitHub UI

  1. Go to the Actions tab in your repository
  2. Select "Test Streetrace Action" or "Test Basic Functionality"
  3. Click "Run workflow"
  4. Optionally customize the agent name and API URL
  5. Monitor the workflow execution

Local Testing

Run the local test script:

./test-local.sh

# With custom parameters:
AGENT_NAME=myagent@v2 STREETRACE_API_URL=https://custom.api.url ./test-local.sh

Automated Tests

# Run unit tests
pnpm test

# Run tests in watch mode
pnpm test:watch

Development

See CLAUDE.md for development guidelines.

Quick Start

# Install dependencies
pnpm install

# Make changes in src/
# ...

# Build the action (required before committing)
pnpm build

# Test locally
./test-local.sh

# Commit both src/ and dist/
git add src/ dist/
git commit -m "feat: your changes"

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •