Documentation / Guides / Status Checks

Status Check Automation

Create commit status checks programmatically with WorkerRun and Node.js-based GitHub Actions.

GitHub commit statuses let you attach pass/fail indicators to specific commits. Combined with branch protection rules, they become powerful quality gates. This guide shows how to create custom status checks using WorkerRun — the check runs in a V8 isolate and posts the result back via the GitHub API.

Note: This example uses actions/github-script@v8 for inline JavaScript. WorkerRun also supports run: steps with 80+ built-in shell commands (echo, curl, jq, grep, sed, etc.) in V8 mode, and full bash in container mode. See Supported Actions for details.

Example: PR Description Check

This workflow verifies that every pull request has a meaningful description (at least 20 characters) and reports the result as a commit status.

.github/workflows/pr-description-check.yml
name: PR Description Check
on:
  pull_request:
    types: [opened, edited, synchronize]

jobs:
  check-description:
    runs-on: worker-run
    steps:
      - name: Require PR description
        uses: actions/github-script@v8
        with:
          script: |
            const { data: pr } = await github.rest.pulls.get({
              ...context.repo,
              pull_number: context.issue.number,
            });

            const hasDescription = pr.body && pr.body.trim().length >= 20;

            await github.rest.repos.createCommitStatus({
              ...context.repo,
              sha: context.sha,
              state: hasDescription ? "success" : "failure",
              description: hasDescription
                ? "PR description looks good"
                : "Please add a PR description (min 20 chars)",
              context: "workerrun/pr-description",
            });

How It Works

  • 1.The workflow triggers on PR open, edit, and synchronize events.
  • 2.It fetches the PR details and checks that body is at least 20 characters long.
  • 3.It posts a commit status with context workerrun/pr-description — either success or failure.
  • 4.Add workerrun/pr-description as a required status check in your branch protection rules to enforce it.