GitHub Action
Codeball AI Code Review
Codeball is a code review AI which approves Pull Requests that a human would have approved. Spend less time waiting, save time and money.
The AI identifies and approves safe contributions, so that you get to focus your energy on the tricky ones.
The Codeball GitHub Action runs Codeball on all new Pull Requests, and approves the Pull Request (example) if the model classifies it as safe.
- Create a new file called
.github/workflows/codeball.yml
with the following content:
name: Codeball
on: [pull_request]
jobs:
codeball_job:
runs-on: ubuntu-latest
name: Codeball
steps:
- name: Codeball
uses: sturdy-dev/codeball-action@v2
with:
approvePullRequests: "true"
labelPullRequestsWhenApproved: "true"
labelPullRequestsWhenReviewNeeded: "false"
failJobsWhenReviewNeeded: "false"
- 🎉 That's it! Codeball will now run on new Pull Requests, and will approve the PR if it's a good one!
Codeball Actions are built on multiple smaller building-blocks, that are heavily configurable through GitHub Actions. Here's a few examples:
If you're using Codeball in another way, please let us know in an issue!
▶️ codeball-dry-run.yml
name: Codeball
on: [pull_request]
jobs:
codeball_job:
runs-on: ubuntu-latest
name: Codeball
steps:
- name: Codeball
uses: sturdy-dev/codeball-action@v2
with:
approvePullRequests: "false"
labelPullRequestsWhenApproved: "true"
labelPullRequestsWhenReviewNeeded: "true"
failJobsWhenReviewNeeded: "false"
▶️ codeball-approve.yml
name: Codeball
on: [pull_request]
jobs:
codeball_job:
runs-on: ubuntu-latest
name: Codeball
steps:
- name: Codeball
uses: sturdy-dev/codeball-action@v2
with:
approvePullRequests: "true"
labelPullRequestsWhenApproved: "false"
labelPullRequestsWhenReviewNeeded: "false"
failJobsWhenReviewNeeded: "false"
▶️ codeball-filter-files.yml
name: Codeball
on:
pull_request:
# Run Codeball only if files under "/web/" has been modified (and no other files)
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths
paths:
- '!**'
- '/web/**'
jobs:
codeball_job:
runs-on: ubuntu-latest
name: Codeball
steps:
- name: Codeball
uses: sturdy-dev/codeball-action@v2
with:
approvePullRequests: "true"
labelPullRequestsWhenApproved: "true"
labelPullRequestsWhenReviewNeeded: "false"
failJobsWhenReviewNeeded: "false"
▶️ codeball-fail-not-approved.yml
name: Codeball
on: [pull_request]
jobs:
codeball_job:
runs-on: ubuntu-latest
name: Codeball
steps:
- name: Codeball
uses: sturdy-dev/codeball-action@v2
with:
approvePullRequests: "true"
labelPullRequestsWhenApproved: "true"
labelPullRequestsWhenReviewNeeded: "false"
failJobsWhenReviewNeeded: "true"
The Codeball sub-actions are:
sturdy-dev/codeball-action/baller/@v2
– Triggers new Codeball Jobssturdy-dev/codeball-action/status/@v2
– Waits for the the Codeball resultsturdy-dev/codeball-action/approver/@v2
– Approves PRssturdy-dev/codeball-action/labeler/@v2
– Adds labels to PRs
Codeball uses a deep learning model that has been trained on over 1 million Pull Requests. For each contribution it considers in hundreds of inputs, including:
- The code diffs (perceptual hashes)
- The author's recent experience with the affected files
- The change frequency of the affected files
- Past code reversals / fix-ups
Codeball is optimized for precision, which means it only approves contributions that it's really confident in.
Codeball works out of the box with GitHub Actions.
If you're using non-default permissions, or want to use a custom access token. Make sure that you're running Codeball with the following permissions:
permissions:
contents: read
issues: write
pull-requests: write
By default, pull requests from a fork does not have "write" permissions when running in GitHub Actions, and those Pull Requests can not be approved or labeled.
If you're using forks from a private repository, and want to use Codeball on Pull Requests created from a fork. Enable "Send write tokens to workflows from fork pull requests" on the repository (docs).