Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/test-md-scanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Test MD Playbook Scanner

on:
pull_request:
paths:
- 'md-playbook-scanner/**'
push:
branches:
- main
paths:
- 'md-playbook-scanner/**'
workflow_dispatch:

jobs:
test-scanner:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create test playbooks
run: |
mkdir -p test-playbooks/subfolder
cat > test-playbooks/deployment.md << 'EOF'
# Deployment Playbook

Deploy the application to production with the following steps:

1. Run tests
2. Build the application
3. Deploy to production
4. Verify deployment
EOF

cat > test-playbooks/code-review.md << 'EOF'
# Code Review Playbook

Review code changes with the following checklist:

- Check code quality
- Verify tests are included
- Review security implications
- Check documentation
EOF

cat > test-playbooks/subfolder/nested.md << 'EOF'
# Nested Test Playbook

This is a playbook in a subdirectory to test recursive scanning.
EOF

- name: Run MD Playbook Scanner
id: scanner
uses: ./md-playbook-scanner
with:
directory: './test-playbooks'
api-key: ${{ secrets.DEVIN_API_KEY }}

- name: Verify outputs
run: |
echo "Playbooks created: ${{ steps.scanner.outputs.playbooks-created }}"
echo "Playbooks failed: ${{ steps.scanner.outputs.playbooks-failed }}"
echo "Playbook IDs: ${{ steps.scanner.outputs.playbook-ids }}"

if [ "${{ steps.scanner.outputs.playbooks-created }}" -lt 3 ]; then
echo "❌ Error: Expected at least 3 playbooks created, got ${{ steps.scanner.outputs.playbooks-created }}"
exit 1
fi

if [ "${{ steps.scanner.outputs.playbooks-failed }}" -gt 0 ]; then
echo "❌ Error: Some playbooks failed to create: ${{ steps.scanner.outputs.playbooks-failed }}"
exit 1
fi

echo "βœ… All tests passed!"

- name: Test with non-existent directory (should fail)
id: test-invalid
continue-on-error: true
uses: ./md-playbook-scanner
with:
directory: './non-existent-directory'
api-key: ${{ secrets.DEVIN_API_KEY }}

- name: Verify error handling
if: steps.test-invalid.outcome != 'failure'
run: |
echo "❌ Error: Action should have failed with non-existent directory"
exit 1
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A collection of GitHub Actions for integrating with the Devin API.

## Available Actions

### Devin API Action
### 1. Devin API Action

A comprehensive GitHub Action for interacting with the Devin API to create and manage Devin sessions programmatically from your GitHub workflows.

Expand All @@ -16,7 +16,7 @@ A comprehensive GitHub Action for interacting with the Devin API to create and m

```yaml
- name: Create Devin Session
uses: samfert-codeium/DEVIN-GITHUB-ACTIONS/devin-action@main
uses: samfert-codeium/DEVIN-GITHUB-ACTIONS/devin-action@v1
id: create-session
with:
action: 'create-session'
Expand All @@ -26,15 +26,47 @@ A comprehensive GitHub Action for interacting with the Devin API to create and m
tags: 'bug-fix,automated'
```

### Features

**Features**:
- **Session Management**: Create sessions, send messages, get status, list sessions
- **File Operations**: Upload files to sessions
- **Tagging**: Update session tags
- **Secrets Management**: Create, list, and delete secrets
- **Knowledge Management**: Manage knowledge base entries
- **Playbooks Management**: Create and manage playbooks

---

### 2. MD Playbook Scanner

Automatically scans a directory for Markdown files and creates Devin playbooks from them.

πŸ“‚ **Location**: [`md-playbook-scanner/`](./md-playbook-scanner/)

πŸ“– **Documentation**: See [md-playbook-scanner/README.md](./md-playbook-scanner/README.md) for detailed usage instructions

πŸš€ **Quick Start**:

```yaml
- name: Scan and create playbooks
uses: samfert-codeium/DEVIN-GITHUB-ACTIONS/md-playbook-scanner@v1
with:
directory: './playbooks'
api-key: ${{ secrets.DEVIN_API_KEY }}
```

**Features**:
- πŸ“ Recursively scans directories for `.md` files
- πŸ“š Automatically creates Devin playbooks using the Devin API
- πŸ“Š Reports detailed statistics (created, failed)
- πŸ” Returns playbook IDs for downstream workflow steps
- ⚠️ Handles errors gracefully with detailed logging

**Use Cases**:
- Automatically sync documentation to Devin playbooks
- Create playbooks from PR templates
- Build a playbook library from markdown docs
- Version control your Devin playbooks alongside your code

### Prerequisites

1. Get a Devin API key from your [Devin settings page](https://app.devin.ai/settings)
Expand Down
Loading
Loading