Skip to content

Commit 71fdbb5

Browse files
Copilotpelikhan
andauthored
Document role requirements for audit/logs tools in agentic-workflows (#15194)
* Initial plan * Document role requirements for audit/logs tools in agentic workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Add role requirements to reference documentation for agentic-workflows tool Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 9963d1b commit 71fdbb5

3 files changed

Lines changed: 38 additions & 2 deletions

File tree

docs/src/content/docs/reference/permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Custom jobs and safe outputs jobs can have their own permission requirements bas
172172

173173
Some tools require specific permissions to function:
174174

175-
- **`agentic-workflows`**: Requires `actions: read` to access workflow logs and run data
175+
- **`agentic-workflows`**: Requires `actions: read` to access workflow logs and run data. Additionally, the `logs` and `audit` tools require the workflow actor to have **write, maintain, or admin** repository role.
176176
- **GitHub Model Context Protocol (MCP) toolsets**: See [Tools](/gh-aw/reference/tools/) for GitHub API permission requirements
177177

178178
The compiler validates these requirements and provides clear error messages when permissions are missing.

docs/src/content/docs/reference/tools.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ tools:
196196
agentic-workflows:
197197
```
198198

199+
> [!NOTE]
200+
> The `logs` and `audit` tools require the workflow actor to have **write, maintain, or admin** repository role. Other tools (status, compile, mcp-inspect, add, update, fix) are available to all users.
201+
199202
See [MCP Server](/gh-aw/setup/mcp-server/#using-as-agentic-workflows-tool) for available operations.
200203

201204
### Cache Memory (`cache-memory:`)

docs/src/content/docs/setup/mcp-server.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ Compile Markdown workflows to GitHub Actions YAML with optional static analysis.
178178

179179
Download and analyze workflow logs with timeout handling and size guardrails.
180180

181+
> [!WARNING]
182+
> Role Requirement
183+
> This tool requires the workflow actor to have **write, maintain, or admin** repository role. Actors with read or triage access will receive a permission denied error.
184+
181185
**Parameters:**
182186
- `workflow_name` (optional): Workflow name to download logs for (empty for all)
183187
- `count` (optional): Number of workflow runs to download (default: 100)
@@ -204,6 +208,10 @@ Download and analyze workflow logs with timeout handling and size guardrails.
204208

205209
Investigate a workflow run, job, or specific step and generate a detailed report.
206210

211+
> [!WARNING]
212+
> Role Requirement
213+
> This tool requires the workflow actor to have **write, maintain, or admin** repository role. Actors with read or triage access will receive a permission denied error.
214+
207215
**Parameters:**
208216
- `run_id_or_url` (required): One of:
209217
- Numeric run ID: `1234567890`
@@ -328,6 +336,31 @@ Check workflow status, download logs, and audit failures.
328336
```
329337

330338
> [!CAUTION]
331-
> Required Permission
339+
> Required Permissions and Roles
340+
>
341+
> **GitHub Actions Permission:**
332342
> The `agentic-workflows` tool requires `actions: read` permission to access GitHub Actions workflow logs and run data.
343+
>
344+
> **Repository Role Requirements:**
345+
> The `logs` and `audit` tools require the workflow actor to have **write, maintain, or admin** role in the repository. These tools check the actor's repository permissions using the GitHub API before allowing access.
346+
>
347+
> - **Minimum role:** write, maintain, or admin
348+
> - **Environment variable:** `GITHUB_ACTOR` must be set (automatically provided in GitHub Actions)
349+
> - **Permission check:** Runtime validation via GitHub API `/repos/{owner}/{repo}/collaborators/{username}/permission`
350+
>
351+
> **Permission Denied Errors:**
352+
>
353+
> If the actor has insufficient permissions (e.g., read or triage access), the tools will return:
354+
> ```json
355+
> {
356+
> "error": "insufficient repository permissions",
357+
> "actor": "username",
358+
> "repository": "owner/repo",
359+
> "role": "read",
360+
> "required": "write, maintain, or admin",
361+
> "reason": "Actor username has read access to owner/repo. This tool requires at least write access."
362+
> }
363+
> ```
364+
>
365+
> **Other tools** (status, compile, mcp-inspect, add, update, fix) are available to all users regardless of repository role.
333366

0 commit comments

Comments
 (0)