|
1 | 1 |  |
2 | 2 |
|
| 3 | +[](https://discord.gg/nE4UcQHZtV) |
| 4 | + |
3 | 5 |
|
4 | 6 | # CODEBALL — AI CODE REVIEW 🔮 |
5 | 7 |
|
@@ -148,6 +150,33 @@ jobs: |
148 | 150 | ``` |
149 | 151 | </details> |
150 | 152 |
|
| 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 | +
|
151 | 180 |
|
152 | 181 | ## Building Blocks |
153 | 182 |
|
@@ -184,8 +213,16 @@ permissions: |
184 | 213 | pull-requests: write |
185 | 214 | ``` |
186 | 215 |
|
| 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 | + |
187 | 222 | ### Forks and private repositories |
188 | 223 |
|
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). |
190 | 227 |
|
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. |
0 commit comments