Pull requests now get explained, when one is worth it

19 hours ago

This pull request adds one workflow file to the artifacts repository. When someone opens a pull request, Claude Code reads it first and decides whether a person who didn't write it would want it walked through. The workflow is a single new file, forty-seven lines, and nothing else changes.

Ask about this presentation

Chapters

  1. 0:00The change
  2. 0:18Judge first
  3. 0:34Triggers
  4. 0:56The step
  5. 1:17Who is left out
  6. 1:39Permissions
  7. 1:57The cost
  8. 2:20Evidence
  9. 2:38What to do
Show transcript
  1. This pull request adds one workflow file to the artifacts repository. When someone opens a pull request, Claude Code reads it first and decides whether a person who didn't write it would want it walked through. The workflow is a single new file, forty-seven lines, and nothing else changes.

    Slide text
    .github/workflows/

    Pull requests now get explained, when one is worth it

    explain-pull-requests.yml +47 −0
  2. A new pull request starts a run. Claude Code reads the pull request and decides whether someone who didn't write it would want it walked through. If yes, the run posts a watch link on the pull request. The rest get no comment, and the reason goes in the run's log.

    Slide text

    Claude Code judges first, then explains or skips

    Opened
    A new pull request starts the run
    →
    Judged
    Claude Code reads the diff
    →
    Explained
    The watch link is posted
    Skipped
    A reason lands in the run log
  3. Three pull request events start a run automatically: opened, ready for review, and reopened. You can also start it by hand with a pull request number. That's how an already merged pull request, number one here, gets explained. Manual runs always explain, because the action ignores the judging setting outside pull request events.

    Slide text
    on:

    Three pull request events run it, and a manual run takes any number

    Automatic
    opened
    ready_for_review
    reopened
    Manual
    pull-request: 1
    Open or merged. Always explains.
  4. The job has one step, and it runs on a free GitHub-hosted Ubuntu runner. It calls the presenter action at version one, the same setup the presenter repository runs on itself. The setting that matters is when: judged, which lets Claude Code decide. It signs in with a Claude Code token stored as a repository secret.

    Slide text
    uses:

    One step does the work, on a free runner

    runs-on: ubuntu-latest

    - uses: bisque-cloud/presenter@v1
    with:
    source: pull-request
    pull-request: ${{ inputs.pull-request }}
    when: judged
    claude-code-oauth-token:
    ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
  5. A condition on the job filters automatic runs before any Claude Code time is spent. Draft pull requests are skipped, and the ready for review event picks them up once they're ready. Pull requests from forks are left out because GitHub gives those runs no secrets. Dependabot pull requests are skipped too. A manual run passes every one of these checks.

    Slide text
    if:

    Drafts, forks and Dependabot never start a run

    !draft
    The ready_for_review event picks it up later
    head repo == this repo
    Forks get no secrets from GitHub
    actor != dependabot[bot]
    Dependency bumps are left alone
  6. The token gets the least it needs. It reads contents, writes to pull requests so it can post the watch link, and requests an ID token so the run can sign in with GitHub to publish. A concurrency group keyed on the pull request number keeps runs for the same pull request from overlapping.

    Slide text
    permissions:

    Read the code, write one comment, sign in to publish

    contents: read
    pull-requests: write # post the watch link
    id-token: write # sign in with GitHub to publish

    One run per pull request at a time: concurrency groups by pull request number.

  7. The author lists one risk. Every Copybara sync pull request gets judged too, which means one Claude Code run for each opened pull request. Those runs count against the Claude plan, and the author expects most of them to end in a skip. The workflow itself is safe from the mirror. The .github folder exists only in this repository, so syncs never overwrite it.

    Slide text
    1 run

    per opened pull request, Copybara syncs included

    Each run is Claude Code time on the Claude plan. Most will be skips.

    .github/ is destination-only in the mirror, so syncs leave this file alone.

  8. There is no test evidence yet, and the pull request says so: it's not yet run. It needs a repository secret called CLAUDE CODE OAUTH TOKEN, which the author creates with claude setup-token. Until that secret is set, this pull request's own run fails at the missing token.

    Slide text
    NOT YET RUN

    The workflow has never run

    CLAUDE_CODE_OAUTH_TOKEN repository secret, made with claude setup-token

    Until it is set, this pull request's own run fails at the missing token.

  9. To review this, check the conditions and permissions in the file, then set the secret. A manual run on the merged pull request number one then exercises the whole path from signing in to the watch link. What stays unknown until real traffic arrives is how often Claude Code skips the Copybara syncs, which decides what this costs on the Claude plan.

    Slide text

    Set the secret, then run it on pull request 1

    Then watch
    Manual run on merged pull request 1 shows the whole path, with the judging setting ignored
    Still unknown
    How often Claude Code skips the Copybara syncs

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built in New York with ❤️