add devsy CI action (#2945)
Some checks are pending
Run tests and pre-commit / Run tests and pre-commit hooks (push) Waiting to run
Run tests and pre-commit / Frontend Lint and Build (push) Waiting to run
Publish Fern Docs / run (push) Waiting to run

This commit is contained in:
Shuchang Zheng 2025-07-20 12:24:12 -07:00 committed by GitHub
parent 422ff7f5b2
commit 6f48309c75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 167 additions and 0 deletions

88
.devsy/setup.sh Executable file
View file

@ -0,0 +1,88 @@
#!/bin/bash
# Devsy Setup Script Example
#
# Copy this file to .devsy/setup.sh in your repository and uncomment the sections
# relevant to your project. This script runs after Python environment setup
# but before Claude Code execution to ensure dependencies are available.
#
# Usage in your workflow:
# - uses: DevsyAI/devsy-action@main
# with:
# setup_script: '.devsy/setup.sh'
echo "🔧 Running Devsy setup..."
# ============================================================================
# PYTHON PROJECTS
# ============================================================================
# Install Python dependencies (uncomment ONE of these based on your project)
# pip install -r requirements.txt
# pip install -r requirements-dev.txt
# pip install -e .
# poetry install
# pipenv install --dev
# ============================================================================
# NODE.JS / JAVASCRIPT / TYPESCRIPT PROJECTS
# ============================================================================
# Install Node dependencies (uncomment as needed)
# npm install
# npm ci # For faster, reproducible builds
# yarn install
# pnpm install
# Build if needed (uncomment as needed)
# npm run build
# npm run compile
# ============================================================================
# RUBY PROJECTS
# ============================================================================
# Install Ruby dependencies (uncomment as needed)
# bundle install
# gem install bundler && bundle install
# ============================================================================
# GO PROJECTS
# ============================================================================
# Download Go dependencies (uncomment as needed)
# go mod download
# go mod tidy
# ============================================================================
# RUST PROJECTS
# ============================================================================
# Build Rust dependencies (uncomment as needed)
# cargo build
# cargo fetch
# ============================================================================
# JAVA PROJECTS
# ============================================================================
# Build Java projects (uncomment based on your build tool)
# mvn compile
# mvn install -DskipTests
# ./gradlew build
# ./gradlew assemble
# ============================================================================
# ENVIRONMENT SETUP
# ============================================================================
# Create .env file from example (uncomment if needed)
# if [ -f ".env.example" ] && [ ! -f ".env" ]; then
# cp .env.example .env
# fi
# Make scripts executable (uncomment if you have scripts)
# chmod +x scripts/*.sh 2>/dev/null || true
# chmod +x bin/* 2>/dev/null || true
echo "✅ Devsy setup completed!"

79
.github/workflows/devsy.yml vendored Normal file
View file

@ -0,0 +1,79 @@
name: Devsy
on:
workflow_dispatch:
inputs:
# === Claude Base Action Configuration ===
model:
description: 'Claude model to use'
required: false
type: string
default: 'sonnet'
# === Devsy Action Configuration ===
mode:
description: 'Action mode: pr-gen, pr-update, or plan-gen'
required: true
type: choice
options:
- pr-gen
- pr-update
- plan-gen
pr_number:
description: 'PR number (required for pr-update mode)'
required: false
type: string
prompt:
description: 'Prompt for Claude (required for pr-gen and plan-gen, optional for pr-update)'
required: false
type: string
# === Callback Configuration (Optional) ===
callback_url:
description: 'URL to send completion callback (optional)'
required: false
type: string
jobs:
run-devsy:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC token generation
contents: write # Required for creating commits and branches if token exchange fails
pull-requests: write # Required for creating and updating PRs if token exchange fails
issues: read # Required for reading issue information if token exchange fails
outputs:
conclusion: ${{ steps.devsy.outputs.conclusion }}
pr_number: ${{ steps.devsy.outputs.pr_number }}
pr_url: ${{ steps.devsy.outputs.pr_url }}
plan_output: ${{ steps.devsy.outputs.plan_output }}
token_source: ${{ steps.devsy.outputs.token_source }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Devsy Action
id: devsy
uses: DevsyAI/devsy-action@main
with:
mode: ${{ inputs.mode }}
pr_number: ${{ inputs.pr_number }}
prompt: ${{ inputs.prompt }}
model: ${{ inputs.model }}
# === Setup Script ===
# Uncomment if you have a setup script:
# setup_script: '.devsy/setup.sh'
# === Tool Configuration ===
# Uncomment and modify these based on your project needs:
allowed_tools: 'Bash(python:*)'
disallowed_tools: ''
# === Callback Configuration ===
callback_url: ${{ inputs.callback_url }}
callback_auth_token: ${{ secrets.DEVSY_ORG_OAUTH_TOKEN }}
# === API Keys ===
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# Alternative AI providers (uncomment if using):
# aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws_region: 'us-east-1'
# google_credentials_json: ${{ secrets.GOOGLE_CREDENTIALS_JSON }}
# google_project_id: ${{ secrets.GOOGLE_PROJECT_ID }}
# google_region: 'us-central1'