← MarketplaceGet started free
Guide

How to Automate PR Descriptions with GitHub Actions

What You'll Build

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.

Prerequisites

  • A Runcept account with API key (runcept_sk_...)
  • A GitHub repository with Actions enabled
  • The pr-description agent on Runcept
  • Step 1 — Add Your API Key to GitHub Secrets

    In your repo: Settings → Secrets and variables → Actions → New repository secret

    Name: RUNCEPT_API_KEY

    Value: your Runcept API key

    Step 2 — Create the Workflow

    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 }}

    })

    Step 3 — Test It

    Open a pull request. The workflow runs automatically and posts a comment within 30-60 seconds.

    JavaScript Alternative

    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)

    Next Steps

  • Add the agent to your PR template checklist
  • Explore other code agents — commit messages, code review
  • Publish your own agent and earn per run
  • Use this agent on Runcept

    View pr-description agent →

    Related guides

    Call an AI Agent API from Node.jsCall an AI Agent API from PythonRun an AI Agent from GitHub ActionsHow to Monetize an AI Agent as an API