Skip to content
Merged
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
90 changes: 90 additions & 0 deletions .github/workflows/agent-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Agent Changelog

on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to generate changelog for"
required: true
type: string

env:
BUN_VERSION: "1.2"

permissions:
contents: write

jobs:
changelog:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0

- uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build CLI
run: cd apps/cli && bun run build

- name: Generate changelog
id: changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ github.ref_name || inputs.tag }}"
echo "📋 Generating changelog for $TAG..."

cd apps/cli
bun run dist/index.js changelog \
--last-release \
--output /tmp/CHANGELOG.md

if [ ! -s /tmp/CHANGELOG.md ]; then
echo "No commits found since last tag — using simple release"
echo "# Release $TAG" > /tmp/CHANGELOG.md
echo "" >> /tmp/CHANGELOG.md
echo "Release $TAG of agent-workbench." >> /tmp/CHANGELOG.md
fi

echo "content<<EOF" >> "$GITHUB_OUTPUT"
cat /tmp/CHANGELOG.md >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"

- name: Create or update GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ github.ref_name || inputs.tag }}"
CHANGELOG="${{ steps.changelog.outputs.content }}"

# Check if release already exists
EXISTING=$(gh release view "$TAG" --json id 2>/dev/null || echo "")

if [ -n "$EXISTING" ]; then
echo "Updating existing release $TAG..."
gh release edit "$TAG" \
--repo "${{ github.repository }}" \
--notes "$CHANGELOG" \
--discussion-category "announcements"
else
echo "Creating new release $TAG..."
gh release create "$TAG" \
--repo "${{ github.repository }}" \
--title "$TAG" \
--notes "$CHANGELOG" \
--generate-notes \
--discussion-category "announcements"
fi

echo "✅ Release $TAG updated with changelog"
72 changes: 72 additions & 0 deletions .github/workflows/agent-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Agent PR Review

on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
pr_number:
description: "PR number to review"
required: true
type: number

env:
BUN_VERSION: "1.2"

permissions:
contents: read
pull-requests: write
checks: write

jobs:
review:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v7
with:
# Fetch full history so git log and gh pr diff work accurately
fetch-depth: 0

- uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build workspace
run: bash scripts/build-all.sh

- name: Build CLI
run: cd apps/cli && bun run build

- name: Run PR review
id: review
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER="${{ github.event.pull_request.number || inputs.pr_number }}"
if [ -z "$PR_NUMBER" ]; then
echo "No PR number available"
exit 1
fi

echo "🔍 Reviewing PR #$PR_NUMBER..."
cd apps/cli
bun run dist/index.js review --pr "$PR_NUMBER" \
--repo "${{ github.repository }}" 2>&1 | tee /tmp/review-output.txt

# Capture exit code
exit ${PIPESTATUS[0]}

- name: Comment on failure
if: failure() && steps.review.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER="${{ github.event.pull_request.number || inputs.pr_number }}"
gh pr comment "$PR_NUMBER" \
--repo "${{ github.repository }}" \
--body "❌ **agent-workbench review found issues** — check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details."
Loading
Loading