You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/examples/issue-pr-events/projectops.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,46 @@ By default, `update-project` is update-only: create the Project once in the GitH
13
13
14
14
**Important**: GitHub Projects v2 requires a PAT or GitHub App token - the default `GITHUB_TOKEN` cannot access Projects v2. Configure [`GH_AW_PROJECT_GITHUB_TOKEN`](/gh-aw/reference/tokens/#gh_aw_project_github_token-github-projects-v2) before using `update-project`.
15
15
16
+
## Token Requirements for Projects v2
17
+
18
+
The type of Personal Access Token (PAT) you need depends on whether you're working with **user-owned** or **organization-owned** Projects:
19
+
20
+
### User-owned Projects (v2)
21
+
22
+
**Must use a classic PAT** - Fine-grained PATs do **not** work with user-owned Projects.
23
+
24
+
Required scopes:
25
+
-`project` (required for user Projects)
26
+
-`repo` (required if accessing private repositories)
-`repo` (required if accessing private repositories)
38
+
39
+
**Option 2: Fine-grained PAT**
40
+
- Repository access: Select specific repos or "All repositories"
41
+
-**Organization permissions** (must be explicitly granted):
42
+
-**Organization access**: Must be granted to the target organization
43
+
-**Projects**: Read+Write
44
+
-**Important**: Fine-grained PATs work by default only for public org resources. You must explicitly grant organization access and Projects permissions.
Copy file name to clipboardExpand all lines: docs/src/content/docs/reference/safe-outputs.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -360,7 +360,11 @@ safe-outputs:
360
360
361
361
Agent output **must include a full GitHub project URL** in the `project` field (e.g., `https://github.com/orgs/myorg/projects/42` or `https://github.com/users/username/projects/5`). Project names or numbers alone are not accepted. Can also supply `content_number`, `content_type`, `fields`, and `campaign_id`. The job adds the issue or PR to the board, updates custom fields, applies `campaign:<id>` labels, and exposes `project-id`, `project-number`, `project-url`, `campaign-id`, and `item-id` outputs. Cross-repository targeting not supported.
362
362
363
-
To opt in to creating missing project boards, include `create_if_missing: true` in the `update_project` output. Your token must have sufficient permissions to create projects in the organization (classic PAT with `project` + `repo` scopes, or fine-grained PAT with Projects: Read+Write, or GitHub App with Projects permissions).
363
+
To opt in to creating missing project boards, include `create_if_missing: true` in the `update_project` output. Your token must have sufficient permissions:
364
+
- **User-owned Projects**: Classic PAT with `project` + `repo` scopes (fine-grained PATs don't work)
365
+
- **Organization-owned Projects**: Classic PAT with `project` + `read:org` scopes, or fine-grained PAT with explicit Organization access and Projects: Read+Write, or GitHub App with Projects permissions
366
+
367
+
See [GitHub Projects v2 token requirements](/gh-aw/reference/tokens/#gh_aw_project_github_token-github-projects-v2) for detailed setup instructions.
Copy file name to clipboardExpand all lines: docs/src/content/docs/reference/tokens.md
+33-6Lines changed: 33 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,13 +197,35 @@ A specialized token for GitHub Projects v2 operations used by the [`update-proje
197
197
198
198
**Setup**:
199
199
200
-
1. Create a **classic PAT** with `project` and `repo` scopes, **OR** a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
200
+
The required token type depends on whether you're working with **user-owned** or **organization-owned** Projects:
201
+
202
+
**For User-owned Projects (v2)**:
203
+
204
+
You **must** use a **classic PAT** with the `project` scope. Fine-grained PATs do **not** work with user-owned Projects.
205
+
206
+
1. Create a [classic PAT](https://github.com/settings/tokens/new) with scopes:
207
+
- `project`(required for user Projects)
208
+
- `repo`(required if accessing private repositories)
209
+
210
+
**For Organization-owned Projects (v2)**:
211
+
212
+
You can use either a classic PAT or a fine-grained PAT:
213
+
214
+
1. **Option A**: Create a **classic PAT** with `project` and `read:org` scopes:
215
+
- `project`(required)
216
+
- `read:org`(required for org Projects)
217
+
- `repo`(required if accessing private repositories)
218
+
219
+
2. **Option B**: Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
201
220
- Repository access: Select specific repos or "All repositories"
202
-
- Organization permissions:
203
-
- Projects: Read+Write (for creating and managing org Projects)
204
-
- **OR** use a GitHub App with Projects: Read+Write permission
221
+
- **Organization permissions** (must be explicitly granted):
222
+
- **Organization access**: Must be granted to the target organization
223
+
- **Projects**: Read+Write (for creating and managing org Projects)
224
+
- **Important**: Fine-grained PATs work by default only for public org resources. You must explicitly grant organization access and Projects permissions.
205
225
206
-
2. Add to repository secrets:
226
+
3. **Option C**: Use a GitHub App with Projects: Read+Write permission
227
+
228
+
After creating your token, add it to repository secrets:
207
229
208
230
```bash wrap
209
231
gh aw secrets set GH_AW_PROJECT_GITHUB_TOKEN --value "YOUR_PROJECT_PAT"
@@ -235,7 +257,12 @@ safe-outputs:
235
257
:::note[Default behavior]
236
258
By default, `update-project` is **update-only**: it will not create projects. If a project doesn't exist, the job fails with instructions to create it manually.
237
259
238
-
**Important**: The default `GITHUB_TOKEN` **cannot** be used for Projects v2 operations. You **must** configure `GH_AW_PROJECT_GITHUB_TOKEN` or provide a custom token via `safe-outputs.update-project.github-token`. GitHub Projects v2 requires GraphQL API access with a PAT (classic with `project` + `repo` scopes, or fine-grained with Projects permissions) or a GitHub App.
260
+
**Important**: The default `GITHUB_TOKEN` **cannot** be used for Projects v2 operations. You **must** configure `GH_AW_PROJECT_GITHUB_TOKEN` or provide a custom token via `safe-outputs.update-project.github-token`.
261
+
262
+
**GitHub Projects v2 PAT Requirements**:
263
+
- **User-owned Projects**: Require a **classic PAT** with the `project` scope (plus `repo` if accessing private repos). Fine-grained PATs do **not** work with user-owned Projects.
264
+
- **Organization-owned Projects**: Can use either a classic PAT with `project` + `read:org` scopes, **or** a fine-grained PAT with explicit Organization access granted plus Projects: Read+Write permission. Fine-grained PATs work by default only for public org resources and must be explicitly granted organization access.
265
+
- **GitHub App**: Works for both user and org Projects with Projects: Read+Write permission.
239
266
240
267
To opt-in to creating projects, the agent must include `create_if_missing: true` in its output, and the token must have sufficient permissions to create projects in the organization.
0 commit comments