Skip to content

Commit 0d6e62e

Browse files
committed
Merge branch 'main' into v2
* main: Add Discord badge examples: skip drafts action: make our action similar to the default one README: document codeball-ai-writer
2 parents 8f68c30 + 6111542 commit 0d6e62e

3 files changed

Lines changed: 58 additions & 3 deletions

File tree

.github/workflows/codeball.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
name: "codeball:approved"
2929
color: "86efac" # green
3030
codeball-job-id: ${{ steps.codeball_baller.outputs.codeball-job-id }}
31-
31+
remove-label-names: "codeball:needs-review"
3232

3333
# If Codeball did not approve the contribution, add a "codeball:needs-review" label
3434
- name: Label Approved
@@ -38,6 +38,7 @@ jobs:
3838
name: "codeball:needs-review"
3939
color: "bfdbfe" # blue
4040
codeball-job-id: ${{ steps.codeball_baller.outputs.codeball-job-id }}
41+
remove-label-names: "codeball:approved"
4142

4243
# If Codeball approved the contribution, approve the PR
4344
- name: Approve PR

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
![Codeball](https://user-images.githubusercontent.com/47952/173048697-d3d39fc3-6238-4fc3-9baf-ccbbb3b4258c.png)
22

3+
[![Discord](https://img.shields.io/badge/join-Discord-blue.svg)](https://discord.gg/nE4UcQHZtV)
4+
35

46
# CODEBALL — AI CODE REVIEW 🔮
57

@@ -148,6 +150,33 @@ jobs:
148150
```
149151
</details>
150152
153+
### Example: Skip Draft pull requests
154+
155+
<details>
156+
<summary>▶️ cskip-drafts.yml</summary>
157+
158+
```yaml
159+
name: Codeball
160+
on:
161+
pull_request:
162+
types:
163+
- opened
164+
- reopened
165+
- synchronize
166+
- ready_for_review
167+
168+
jobs:
169+
codeball_job:
170+
runs-on: ubuntu-latest
171+
if: ${{ !github.event.pull_request.draft }}
172+
name: Codeball
173+
steps:
174+
- name: Codeball
175+
uses: sturdy-dev/codeball-action@v2
176+
```
177+
</details>
178+
179+
151180
152181
## Building Blocks
153182
@@ -184,8 +213,16 @@ permissions:
184213
pull-requests: write
185214
```
186215

216+
### Forks and public repositories
217+
218+
GitHub does not offer (and reasonably so) a way for Pull Requests from a fork to a public repository to run with "write" permissions to the parent repository.
219+
220+
If you want to use Codeball on a public repository, install the ["Codeball AI Writer"](https://github.com/apps/codeball-ai-writer) app on the parent repository. This allows the Codeball Action to use the permissions from the app as a fallback if the action is running without write permissions.
221+
187222
### Forks and private repositories
188223

189-
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.
224+
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.
225+
226+
The easiest workaround to this issue is to install the ["Codeball AI Writer"](https://github.com/apps/codeball-ai-writer) app (see instructions for how to use Codeball on a public repository).
190227

191-
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](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#enabling-workflows-for-private-repository-forks)).
228+
Alternatively, you can enable "Send write tokens to workflows from fork pull requests" on the repository ([docs](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#enabling-workflows-for-private-repository-forks)) via GitHub.

examples/skip-drafts.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Codeball
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- reopened
7+
- synchronize
8+
- ready_for_review
9+
10+
jobs:
11+
codeball_job:
12+
runs-on: ubuntu-latest
13+
if: ${{ !github.event.pull_request.draft }}
14+
name: Codeball
15+
steps:
16+
- name: Codeball
17+
uses: sturdy-dev/codeball-action@v2

0 commit comments

Comments
 (0)