A GitHub Actions workflow that automatically calls the Runcept API on every pull request, generates a description from the diff, and posts it as a PR comment — no developer input required.
runcept_sk_...)pr-description agent on RunceptIn your repo: Settings → Secrets and variables → Actions → New repository secret
Name: RUNCEPT_API_KEY
Value: your Runcept API key
Create .github/workflows/pr-description.yml:
name: AI PR Description
on:
pull_request:
types: [opened, synchronize]
jobs:
describe:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get diff
id: diff
run: |
DIFF=$(git diff origin/${{ github.base_ref }}...HEAD -- . ':(exclude)*.lock' | head -c 8000)
echo "content<> $GITHUB_OUTPUT
echo "$DIFF" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Run agent
id: agent
run: |
RESPONSE=$(curl -sS -X POST https://www.runcept.com/api/v1/run \
-H "Authorization: Bearer ${{ secrets.RUNCEPT_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"agent": "pr-description", "input": {"diff": ${{ toJson(steps.diff.outputs.content) }}}}')
JOB_ID=$(echo $RESPONSE | jq -r '.job_id')
# Poll for result
for i in {1..30}; do
RESULT=$(curl -sS https://www.runcept.com/api/v1/jobs/$JOB_ID \
-H "Authorization: Bearer ${{ secrets.RUNCEPT_API_KEY }}")
STATUS=$(echo $RESULT | jq -r '.status')
if [ "$STATUS" = "complete" ]; then
echo "description=$(echo $RESULT | jq -r '.output.description')" >> $GITHUB_OUTPUT
break
fi
sleep 3
done
- name: Post comment
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ## AI-Generated Description\n\n${{ steps.agent.outputs.description }}
})
Open a pull request. The workflow runs automatically and posts a comment within 30-60 seconds.
If you prefer a Node.js script instead of curl:
import { RunceptClient } from '@runcept/sdk'
const client = new RunceptClient({ apiKey: process.env.RUNCEPT_API_KEY })
const result = await client.run('pr-description', { diff: process.env.PR_DIFF })
console.log(result.output.description)
Use this agent on Runcept
View pr-description agent →