diff --git a/.github/aw/create-agentic-workflow.md b/.github/aw/create-agentic-workflow.md
index ea5cb79c5f..906f092e89 100644
--- a/.github/aw/create-agentic-workflow.md
+++ b/.github/aw/create-agentic-workflow.md
@@ -266,7 +266,7 @@ These resources contain workflow patterns, best practices, safe outputs, and per
**Authentication Setup:**
```yaml
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }} # PAT with access to target repos
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }} # PAT with access to target repos
create-issue:
max: 5
add-comment:
@@ -315,7 +315,7 @@ These resources contain workflow patterns, best practices, safe outputs, and per
**Documentation Reference:**
- Full guide: https://github.github.com/gh-aw/patterns/multi-repo-ops/
- Safe Outputs Reference: https://github.github.com/gh-aw/reference/safe-outputs/
- - GitHub Tools: https://github.github.com/gh-aw/reference/tools/#github-tools-github
+ - GitHub Tools: https://github.github.com/gh-aw/reference/github-tools/
**Custom Safe Output Jobs (for new safe outputs):**
@@ -618,7 +618,7 @@ Based on the parsed requirements, determine:
If the workflow involves cross-repository operations, follow these additional guidelines:
**Authentication Configuration:**
-- Add `safe-outputs.github-token: ${{ secrets.CROSS_REPO_PAT }}` for PAT authentication
+- Add `safe-outputs.github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}` for PAT authentication
- Or use `safe-outputs.app` for GitHub App authentication
- Document required PAT scopes in the workflow description
@@ -648,7 +648,7 @@ tools:
github:
toolsets: [repos, issues, pull_requests]
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
max: 5
add-comment:
diff --git a/.github/aw/github-agentic-workflows.md b/.github/aw/github-agentic-workflows.md
index f7b84e916e..3f7b23bc25 100644
--- a/.github/aw/github-agentic-workflows.md
+++ b/.github/aw/github-agentic-workflows.md
@@ -745,7 +745,7 @@ The YAML frontmatter supports these fields:
update-release:
max: 1 # Optional: max releases (default: 1, max: 10)
target-repo: "owner/repo" # Optional: cross-repository
- github-token: ${{ secrets.CUSTOM_TOKEN }} # Optional: custom token
+ github-token: ${{ secrets.GH_AW_UPDATE_RELEASE_TOKEN }} # Optional: custom token
```
Operation types: `replace`, `append`, `prepend`.
- `upload-asset:` - Publish files to orphaned git branch
@@ -895,7 +895,7 @@ The YAML frontmatter supports these fields:
safe-outputs:
create-issue:
add-comment:
- github-token: ${{ secrets.CUSTOM_PAT }} # Use custom PAT instead of GITHUB_TOKEN
+ github-token: ${{ secrets.GH_AW_SAFE_OUTPUTS_TOKEN }} # Use custom PAT instead of GITHUB_TOKEN
```
Useful when you need additional permissions or want to perform actions across repositories.
- `allowed-domains:` - Allowed domains for URLs in safe output content (array)
diff --git a/actions/setup/js/extra_empty_commit.cjs b/actions/setup/js/extra_empty_commit.cjs
index 98dffcf30b..185af5fad4 100644
--- a/actions/setup/js/extra_empty_commit.cjs
+++ b/actions/setup/js/extra_empty_commit.cjs
@@ -9,7 +9,10 @@
* GITHUB_TOKEN do not trigger other workflow runs.
*
* The token comes from `github-token-for-extra-empty-commit` in safe-outputs config
- * (passed as GH_AW_EXTRA_EMPTY_COMMIT_TOKEN env var), or `app` for GitHub App authentication.
+ * (passed as GH_AW_EXTRA_EMPTY_COMMIT_TOKEN env var). Supported values:
+ * - `app` - Use GitHub App token from safe-outputs-app-token step
+ * - `default` - Use the magic secret GH_AW_CI_TRIGGER_TOKEN
+ * - `${{ secrets.CUSTOM_TOKEN }}` - Use a custom PAT or secret
*/
/**
diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs
index 8e3f1a261f..00244c490c 100644
--- a/docs/astro.config.mjs
+++ b/docs/astro.config.mjs
@@ -209,6 +209,7 @@ export default defineConfig({
items: [
{ label: 'AI Engines', link: '/reference/engines/' },
{ label: 'Authentication', link: '/reference/auth/' },
+ { label: 'Authentication (Projects)', link: '/reference/auth-projects/' },
{ label: 'Cache Memory', link: '/reference/cache-memory/' },
{ label: 'Command Triggers', link: '/reference/command-triggers/' },
{ label: 'Compilation Process', link: '/reference/compilation-process/' },
diff --git a/docs/src/content/docs/examples/multi-repo.md b/docs/src/content/docs/examples/multi-repo.md
index f4ee6891e9..6f873fbced 100644
--- a/docs/src/content/docs/examples/multi-repo.md
+++ b/docs/src/content/docs/examples/multi-repo.md
@@ -26,7 +26,7 @@ All multi-repo workflows require proper authentication:
gh auth token
# Store as repository or organization secret
-gh aw secrets set CROSS_REPO_PAT --value "ghp_your_token_here"
+gh aw secrets set GH_AW_CROSS_REPO_PAT --value "ghp_your_token_here"
```
The PAT needs permissions **only on target repositories** (not the source repository where the workflow runs): `repo` for private repos, `contents: write` for commits, `issues: write` for issues, and `pull-requests: write` for PRs.
@@ -92,7 +92,7 @@ Most safe output types support the `target-repo` parameter for cross-repository
```yaml wrap
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
target-repo: "org/tracking-repo" # Cross-repo: creates in tracking-repo
title-prefix: "[component] "
@@ -141,7 +141,7 @@ engine:
uses: actions/checkout@v5
with:
repository: org/secondary-repo
- token: ${{ secrets.CROSS_REPO_PAT }}
+ token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
path: secondary-repo
```
@@ -158,6 +158,6 @@ For comprehensive documentation on the MultiRepoOps design pattern, see:
## Related Documentation
- [Safe Outputs Reference](/gh-aw/reference/safe-outputs/) - Configuration options
-- [GitHub Tools](/gh-aw/reference/tools/#github-tools-github) - API access configuration
+- [GitHub Tools](/gh-aw/reference/github-tools/) - API access configuration
- [Security Best Practices](/gh-aw/introduction/architecture/) - Authentication and security
- [Reusing Workflows](/gh-aw/guides/packaging-imports/) - Sharing workflows
diff --git a/docs/src/content/docs/examples/multi-repo/feature-sync.md b/docs/src/content/docs/examples/multi-repo/feature-sync.md
index f3ba38902f..376725cf63 100644
--- a/docs/src/content/docs/examples/multi-repo/feature-sync.md
+++ b/docs/src/content/docs/examples/multi-repo/feature-sync.md
@@ -36,7 +36,7 @@ tools:
bash:
- "git:*"
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-pull-request:
target-repo: "myorg/downstream-service"
title-prefix: "[sync] "
@@ -71,7 +71,7 @@ tools:
bash:
- "git:*"
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-pull-request:
max: 3
title-prefix: "[core-sync] "
@@ -103,7 +103,7 @@ tools:
bash:
- "git:*"
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-pull-request:
target-repo: "myorg/production-service"
title-prefix: "[upgrade] "
@@ -139,7 +139,7 @@ tools:
bash:
- "git:*"
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-pull-request:
target-repo: "myorg/client-sdk"
title-prefix: "[types] "
@@ -173,7 +173,7 @@ tools:
bash:
- "git:*"
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-pull-request:
target-repo: "myorg/sister-project"
title-prefix: "[config-sync] "
@@ -208,7 +208,7 @@ tools:
bash:
- "git:*"
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-pull-request:
target-repo: "myorg/integration-tests"
title-prefix: "[feature-test] "
@@ -238,7 +238,7 @@ tools:
bash:
- "git:*"
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-pull-request:
target-repo: "myorg/downstream-fork"
title-prefix: "[weekly-sync] "
@@ -260,7 +260,7 @@ Cross-repo sync workflows require authentication via PAT or GitHub App.
Create a PAT with `repo`, `contents: write`, and `pull-requests: write` permissions, then store it as a repository secret:
```bash
-gh aw secrets set CROSS_REPO_PAT --value "ghp_your_token_here"
+gh aw secrets set GH_AW_CROSS_REPO_PAT --value "ghp_your_token_here"
```
### GitHub App Configuration
@@ -272,4 +272,4 @@ For enhanced security, use GitHub App installation tokens. See [Using a GitHub A
- [MultiRepoOps Design Pattern](/gh-aw/patterns/multi-repo-ops/) - Complete multi-repo overview
- [Cross-Repo Issue Tracking](/gh-aw/examples/multi-repo/issue-tracking/) - Issue management patterns
- [Safe Outputs Reference](/gh-aw/reference/safe-outputs/) - Pull request configuration
-- [GitHub Tools](/gh-aw/reference/tools/#github-tools-github) - Repository access tools
+- [GitHub Tools](/gh-aw/reference/github-tools/) - Repository access tools
diff --git a/docs/src/content/docs/examples/multi-repo/issue-tracking.md b/docs/src/content/docs/examples/multi-repo/issue-tracking.md
index ac2534cb88..5fc7726354 100644
--- a/docs/src/content/docs/examples/multi-repo/issue-tracking.md
+++ b/docs/src/content/docs/examples/multi-repo/issue-tracking.md
@@ -31,7 +31,7 @@ tools:
github:
toolsets: [issues]
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
target-repo: "myorg/central-tracker"
title-prefix: "[component-alpha] "
@@ -66,7 +66,7 @@ tools:
github:
toolsets: [issues]
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
add-comment:
target-repo: "myorg/central-tracker"
target: "*" # Find related tracking issue
@@ -99,7 +99,7 @@ tools:
github:
toolsets: [issues]
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
max: 3 # May create issues in multiple tracking repos
target-repo: "myorg/central-tracker"
@@ -136,7 +136,7 @@ tools:
toolsets: [issues]
web-fetch:
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
target-repo: "myorg/dependency-tracker"
title-prefix: "[upstream] "
@@ -168,7 +168,7 @@ tools:
github:
toolsets: [issues]
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
max: 2
title-prefix: "[auto-triaged] "
@@ -197,7 +197,7 @@ tools:
github:
toolsets: [issues]
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-discussion:
target-repo: "myorg/central-tracker"
category: "Status Reports"
@@ -228,7 +228,7 @@ tools:
github:
toolsets: [issues]
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
target-repo: "myorg/central-tracker"
title-prefix: "[linked] "
@@ -261,7 +261,7 @@ tools:
github:
toolsets: [issues]
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
max: 1
title-prefix: "[priority-routed] "
@@ -285,7 +285,7 @@ Cross-repo issue tracking requires appropriate authentication:
```bash
# Create PAT with issues and repository read permissions
-gh aw secrets set CROSS_REPO_PAT --value "ghp_your_token_here"
+gh aw secrets set GH_AW_CROSS_REPO_PAT --value "ghp_your_token_here"
```
**Required Permissions:**
@@ -301,4 +301,4 @@ For enhanced security, use GitHub App installation tokens. See [Using a GitHub A
- [MultiRepoOps Design Pattern](/gh-aw/patterns/multi-repo-ops/) - Complete multi-repo overview
- [Feature Synchronization](/gh-aw/examples/multi-repo/feature-sync/) - Code sync patterns
- [Safe Outputs Reference](/gh-aw/reference/safe-outputs/) - Issue creation configuration
-- [GitHub Tools](/gh-aw/reference/tools/#github-tools-github) - API access configuration
+- [GitHub Tools](/gh-aw/reference/github-tools/) - API access configuration
diff --git a/docs/src/content/docs/examples/project-tracking.md b/docs/src/content/docs/examples/project-tracking.md
index 8d0dff80be..5d2c88f2ce 100644
--- a/docs/src/content/docs/examples/project-tracking.md
+++ b/docs/src/content/docs/examples/project-tracking.md
@@ -64,8 +64,6 @@ safe-outputs:
github-token: ${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}
```
-### Configuration Fields
-
| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `project` | string | (required) | GitHub Project URL for update-project or create-project-status-update |
@@ -75,38 +73,9 @@ safe-outputs:
See [Safe Outputs: Project Board Updates](/gh-aw/reference/safe-outputs/#project-board-updates-update-project) for complete configuration details.
-## Prerequisites
-
-### 1. Create a GitHub Project
-
-Create a Projects V2 board in the GitHub UI before configuring your workflow. You'll need the Project URL from the browser address bar.
-
-### 2. Set Up Authentication
-
-#### For User-Owned Projects
-
-Use a **classic PAT** with scopes:
-- `project` (required)
-- `repo` (if accessing private repositories)
-
-#### For Organization-Owned Projects
-
-Use a **fine-grained PAT** with:
-- Repository access: Select specific repos
-- Repository permissions:
- - Contents: Read
- - Issues: Read (if workflow triggers on issues)
- - Pull requests: Read (if workflow triggers on pull requests)
-- Organization permissions:
- - Projects: Read & Write
-
-### 3. Store the Token
-
-```bash
-gh aw secrets set GH_AW_PROJECT_GITHUB_TOKEN --value "YOUR_PROJECT_TOKEN"
-```
+### Authentication
-See the [GitHub Projects V2 authentication](/gh-aw/reference/auth/#gh_aw_project_github_token) for complete details.
+See [Authentication (Projects)](/gh-aw/reference/auth-projects/).
## Example: Issue Triage
@@ -314,6 +283,6 @@ Update the project item with the team field.
- [Safe Outputs Reference](/gh-aw/reference/safe-outputs/) - Complete safe-outputs documentation
- [update-project](/gh-aw/reference/safe-outputs/#project-board-updates-update-project) - Detailed update-project configuration
- [create-project-status-update](/gh-aw/reference/safe-outputs/#project-status-updates-create-project-status-update) - Status update configuration
-- [GitHub Projects V2 Authentication](/gh-aw/reference/auth/#gh_aw_project_github_token) - Token setup guide
+- [GitHub Projects Authentication](/gh-aw/reference/auth-projects/) - Token setup guide
- [Projects & Monitoring](/gh-aw/patterns/monitoring/) - Design pattern guide
- [Orchestration](/gh-aw/patterns/orchestration/) - Design pattern guide
diff --git a/docs/src/content/docs/guides/getting-started-mcp.md b/docs/src/content/docs/guides/getting-started-mcp.md
index ac92c1d244..8457a52a26 100644
--- a/docs/src/content/docs/guides/getting-started-mcp.md
+++ b/docs/src/content/docs/guides/getting-started-mcp.md
@@ -132,17 +132,6 @@ tools:
```
Local mode runs the MCP server in a Docker container, useful for pinning specific versions or offline environments.
-### Authentication
-
-Tokens are used in order: `github-token` configuration field, [`GH_AW_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_token) secret, then `GITHUB_TOKEN` (default).
-
-```yaml wrap
-tools:
- github:
- github-token: "${{ secrets.CUSTOM_PAT }}" # Optional custom token
- toolsets: [default]
-```
-
### Read-Only Mode
Restrict operations to read-only for security-sensitive workflows:
@@ -314,7 +303,7 @@ gh aw compile my-workflow --validate --strict
**Tool not found:** Run `gh aw mcp inspect my-workflow` to verify available tools. Ensure the correct toolset is enabled or that tool names in `allowed:` match exactly.
-**Authentication errors:** Verify the secret exists in repository settings and has required scopes. For remote mode, set [`GH_AW_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_token) with a PAT.
+**Authentication errors:** Verify the secret exists in repository settings and has required scopes.
**Connection failures:** Check URL syntax for HTTP servers, network configuration for containers, and verify Docker images exist.
diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx
index 9f37b6c07b..88f6301f29 100644
--- a/docs/src/content/docs/index.mdx
+++ b/docs/src/content/docs/index.mdx
@@ -41,7 +41,7 @@ Developed by GitHub Next and Microsoft Research, workflows run with added guardr
Workflows that understand context and adapt to situations
-
+
Deep integration with Actions, Issues, PRs, Discussions, and repository management
diff --git a/docs/src/content/docs/patterns/central-repo-ops.mdx b/docs/src/content/docs/patterns/central-repo-ops.mdx
index 52c61ac76d..15e3910f4d 100644
--- a/docs/src/content/docs/patterns/central-repo-ops.mdx
+++ b/docs/src/content/docs/patterns/central-repo-ops.mdx
@@ -48,7 +48,7 @@ on:
tools:
github:
- github-token: ${{ secrets.ORG_GITHUB_MCP_SERVER_TOKEN }}
+ github-token: ${{ secrets.GH_AW_READ_ORG_TOKEN }}
toolsets: [repos]
safe-outputs:
@@ -81,7 +81,7 @@ Categorize and orchestrate Dependabot rollout across repositories.
```
Compile this workflow to generate the lock file: `gh aw compile`.
-Create a fine-grained PAT `ORG_GITHUB_MCP_SERVER_TOKEN` with the organization as an owner,
+Create a fine-grained PAT `GH_AW_READ_ORG_TOKEN` with the organization as an owner,
select "All repositories" (or allowlist of specific repos), and grant Repository permission: `Contents: Read-only`.
Add this into your Actions repository secrets. This gives the orchestrator read access to all candidate repositories.
@@ -113,11 +113,11 @@ permissions:
tools:
github:
- github-token: ${{ secrets.ORG_GITHUB_MCP_SERVER_TOKEN }}
+ github-token: ${{ secrets.GH_AW_READ_ORG_TOKEN }}
toolsets: [repos]
safe-outputs:
- github-token: ${{ secrets.REPO_SAFE_OUTPUTS_TOKEN }}
+ github-token: ${{ secretsGH_AW_CROSS_REPO_PAT }}
create-pull-request:
target-repo: ${{ github.event.inputs.target_repo }}
title-prefix: '[dependabot] '
diff --git a/docs/src/content/docs/patterns/multi-repo-ops.md b/docs/src/content/docs/patterns/multi-repo-ops.md
index bf3d468c5c..4f6c9d1a2d 100644
--- a/docs/src/content/docs/patterns/multi-repo-ops.md
+++ b/docs/src/content/docs/patterns/multi-repo-ops.md
@@ -28,7 +28,7 @@ permissions:
contents: read
actions: read
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
target-repo: "org/tracking-repo"
title-prefix: "[component-a] "
@@ -58,7 +58,7 @@ Configure a Personal Access Token with access to target repositories:
```yaml wrap
safe-outputs:
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
create-issue:
target-repo: "org/tracking-repo"
```
@@ -175,7 +175,7 @@ engine:
uses: actions/checkout@v5
with:
repository: org/secondary-repo
- token: ${{ secrets.CROSS_REPO_PAT }}
+ token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
path: secondary-repo
- name: Compare and sync
@@ -257,6 +257,6 @@ For organization-wide workflows:
## Related Documentation
- [Safe Outputs Reference](/gh-aw/reference/safe-outputs/) - Complete safe output configuration
-- [GitHub Tools](/gh-aw/reference/tools/#github-tools-github) - GitHub API toolsets
+- [GitHub Tools](/gh-aw/reference/github-tools/) - GitHub API toolsets
- [Security Best Practices](/gh-aw/introduction/architecture/) - Authentication and token security
- [Reusing Workflows](/gh-aw/guides/packaging-imports/) - Sharing workflows across repos
diff --git a/docs/src/content/docs/patterns/project-ops.mdx b/docs/src/content/docs/patterns/project-ops.mdx
index d90b263114..5b6d87a075 100644
--- a/docs/src/content/docs/patterns/project-ops.mdx
+++ b/docs/src/content/docs/patterns/project-ops.mdx
@@ -15,7 +15,7 @@ Safe outputs handle all project operations in separate, scoped jobs with minimal
1. **Create a Project**: Before you wire up a workflow, you must first create the Project in the GitHub UI (user or organization level). Keep the Project URL handy (you'll need to reference it in your workflow instructions).
-2. **Arrange access**: See [Projects authentication](/gh-aw/reference/auth/#gh_aw_project_github_token) for complete details.
+2. Add **Additional Authentication** to your workflow: See [Authentication (Projects)](/gh-aw/reference/auth-projects/) for setup instructions.
## Example: Smart Issue Triage
@@ -97,6 +97,10 @@ Each safe output operates in a separate job with minimal, scoped permissions. Se
See the [Safe Outputs reference](/gh-aw/reference/safe-outputs/#project-board-updates-update-project) for project field and view configuration.
+## Authentication for Project Operations
+
+Project operations require additional authentication since the default `GITHUB_TOKEN` lacks necessary permissions for the Projects API. See [Authentication (Projects)](/gh-aw/reference/auth-projects/).
+
## When to Use ProjectOps
ProjectOps complements [GitHub's built-in Projects automation](https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/using-the-built-in-automations) with AI-powered intelligence:
@@ -113,7 +117,7 @@ ProjectOps complements [GitHub's built-in Projects automation](https://docs.gith
**Field Name Mismatches**: Custom field names are case-sensitive. Use exact field names as defined in project settings. Field names are automatically normalized (e.g., `story_points` matches `Story Points`).
-**Token Scope**: Default `GITHUB_TOKEN` cannot access Projects. Store a PAT with Projects permissions in [`GH_AW_PROJECT_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_project_github_token) secret.
+**Token Scope**: Default `GITHUB_TOKEN` cannot access Projects. See [Authentication (Projects)](/gh-aw/reference/auth-projects/) for setup.
**Project URL Format**: Use full project URLs (e.g., `https://github.com/orgs/myorg/projects/42`), not project numbers alone.
@@ -121,9 +125,10 @@ ProjectOps complements [GitHub's built-in Projects automation](https://docs.gith
## Additional Resources
+- [Authentication (Projects)](/gh-aw/reference/auth-projects/) - Project-specific authentication setup
- [Safe Outputs Reference](/gh-aw/reference/safe-outputs/) - Complete safe output configuration and API details
- [Projects & Monitoring](/gh-aw/patterns/monitoring/) - Design pattern guide
- [Orchestration](/gh-aw/patterns/orchestration/) - Design pattern guide
- [Trigger Events](/gh-aw/reference/triggers/) - Event trigger configuration options
- [IssueOps](/gh-aw/patterns/issue-ops/) - Related issue automation patterns
-- [Token Reference](/gh-aw/reference/auth/#gh_aw_project_github_token) - GitHub Projects token setup
+- [Authentication Reference](/gh-aw/reference/auth/) - All tokens and secrets
diff --git a/docs/src/content/docs/patterns/side-repo-ops.mdx b/docs/src/content/docs/patterns/side-repo-ops.mdx
index 57b58fcfe5..26062eefa1 100644
--- a/docs/src/content/docs/patterns/side-repo-ops.mdx
+++ b/docs/src/content/docs/patterns/side-repo-ops.mdx
@@ -69,7 +69,7 @@ Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/n
For classic PATs, use the `repo` scope. Store the token as a secret:
```bash
-gh aw secrets set MAIN_REPO_PAT --value "YOUR_PAT_HERE"
+gh aw secrets set GH_AW_MAIN_REPO_TOKEN --value "YOUR_PAT_HERE"
```
> [!TIP]
@@ -101,7 +101,7 @@ permissions:
contents: read
safe-outputs:
- github-token: ${{ secrets.MAIN_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }}
create-issue:
target-repo: "my-org/main-repo"
title-prefix: "[automation] "
@@ -147,7 +147,7 @@ permissions:
contents: read
safe-outputs:
- github-token: ${{ secrets.MAIN_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }}
create-issue:
target-repo: "my-org/main-repo"
max: 5
@@ -192,14 +192,14 @@ For private repositories, your PAT must have explicit repository access with app
```yaml wrap
safe-outputs:
- github-token: ${{ secrets.MAIN_REPO_PAT }} # Required for private repos
+ github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }} # Required for private repos
create-issue:
target-repo: "my-org/private-main-repo"
tools:
github:
mode: remote
- github-token: ${{ secrets.MAIN_REPO_PAT }} # Explicit token for tools
+ github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }} # Explicit token for tools
toolsets: [repos, issues, pull_requests]
```
@@ -217,7 +217,7 @@ Run triage workflows on main repository issues:
on: every 6h
safe-outputs:
- github-token: ${{ secrets.MAIN_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }}
add-labels:
target-repo: "my-org/main-repo"
add-comment:
@@ -243,7 +243,7 @@ Monitor main repository for quality issues:
on: weekly on monday
safe-outputs:
- github-token: ${{ secrets.MAIN_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }}
create-issue:
target-repo: "my-org/main-repo"
labels: [code-quality, automation]
@@ -280,7 +280,7 @@ on:
default: "docs/"
safe-outputs:
- github-token: ${{ secrets.MAIN_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }}
create-pull-request:
target-repo: "my-org/main-repo"
base-branch: main
@@ -302,7 +302,7 @@ Create a PR with suggested improvements.
### Authentication Failures
-If you see "Resource not accessible by integration" errors, verify your PAT has access to the target repository, check permissions include required scopes, ensure the PAT hasn't expired, and confirm `github-token: ${{ secrets.MAIN_REPO_PAT }}` is configured (not `GITHUB_TOKEN`).
+If you see "Resource not accessible by integration" errors, verify your PAT has access to the target repository, check permissions include required scopes, ensure the PAT hasn't expired, and confirm `github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }}` is configured (not `GITHUB_TOKEN`).
### GitHub Tools Not Working
@@ -312,7 +312,7 @@ If the agent cannot read files from the main repository, use `mode: remote` for
tools:
github:
mode: remote
- github-token: ${{ secrets.MAIN_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }}
toolsets: [repos]
```
@@ -358,7 +358,7 @@ on:
required: true
safe-outputs:
- github-token: ${{ secrets.MULTI_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_MULTI_REPO_PAT }}
create-issue:
target-repo: ${{ inputs.target_repo }} # Dynamic target
---
@@ -385,7 +385,7 @@ on:
types: [opened, labeled]
safe-outputs:
- github-token: ${{ secrets.SIDE_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_SIDE_REPO_TOKEN }}
add-comment:
target-repo: "my-org/automation-repo"
```
@@ -401,7 +401,7 @@ This creates a feedback loop where the side repository tracks automation effecti
## Related Documentation
- [Safe Outputs Reference](/gh-aw/reference/safe-outputs/) - Complete safe output configuration
-- [GitHub Tools](/gh-aw/reference/tools/#github-tools-github) - GitHub API toolsets
+- [GitHub Tools](/gh-aw/reference/github-tools/) - GitHub API toolsets
- [Authentication](/gh-aw/reference/auth/) - Token types and precedence
- [Security Best Practices](/gh-aw/introduction/architecture/) - Authentication and security
- [Reusing Workflows](/gh-aw/guides/packaging-imports/) - Sharing workflows
diff --git a/docs/src/content/docs/reference/assign-to-copilot.mdx b/docs/src/content/docs/reference/assign-to-copilot.mdx
new file mode 100644
index 0000000000..764726b5cf
--- /dev/null
+++ b/docs/src/content/docs/reference/assign-to-copilot.mdx
@@ -0,0 +1,117 @@
+---
+title: Assign to Copilot
+description: Programmatically assign GitHub Copilot coding agent to issues and pull requests
+sidebar:
+ order: 810
+---
+
+import Video from '../../../components/Video.astro';
+
+This page describes how to programmatically assign the [GitHub Copilot coding agent](https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-coding-agent) to issues or pull requests using the `assign-to-agent` safe output. This automates the [standard GitHub workflow for assigning issues to Copilot](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-a-pr#assigning-an-issue-to-copilot).
+
+## When to Use
+
+Use `assign-to-agent` when you need to programmatically assign Copilot coding agent to **existing** issues or PRs through workflow automation.
+
+If you're creating new issues and want to assign Copilot coding agent immediately, use `assignees: copilot` in your [`create-issue`](/gh-aw/reference/safe-outputs/#issue-creation-create-issue) configuration instead.
+
+## Configuration
+
+```yaml wrap
+safe-outputs:
+ assign-to-agent:
+ name: "copilot" # default agent (default: "copilot")
+ model: "claude-opus-4.6" # default AI model (default: "auto")
+ custom-agent: "agent-id" # default custom agent ID (optional)
+ custom-instructions: "..." # default custom instructions (optional)
+ allowed: [copilot] # restrict to specific agents (optional)
+ max: 1 # max assignments (default: 1)
+ target: "triggering" # "triggering" (default), "*", or number
+ target-repo: "owner/repo" # where the issue lives (cross-repository)
+ pull-request-repo: "owner/repo" # where the PR should be created (may differ from issue repo)
+ allowed-pull-request-repos: [owner/repo1, owner/repo2] # additional allowed PR repositories
+ base-branch: "develop" # target branch for PR (default: target repo's default branch)
+ github-token: ${{ secrets.GH_AW_AGENT_TOKEN }} # token for permissions
+```
+
+**Supported agents:** `copilot` (`copilot-swe-agent`)
+
+## Target Issue or Pull Request
+
+The `target` parameter determines which issue or PR to assign the agent to:
+
+- `target: "triggering"` (default) - Auto-resolves from `github.event.issue.number` or `github.event.pull_request.number`
+- `target: "*"` - Requires explicit `issue_number` or `pull_number` in agent output
+- `target: "123"` - Always uses issue/PR #123
+
+## Cross-Repository PR Creation
+
+The `pull-request-repo` parameter allows you to create pull requests in a different repository than where the issue lives. This is useful when:
+
+- Issues are tracked in a central repository but code lives in separate repositories
+- You want to separate issue tracking from code repositories
+
+When `pull-request-repo` is configured, Copilot will create the pull request in the specified repository instead of the issue's repository. The issue repository is determined by `target-repo` or defaults to the workflow's repository.
+
+The repository specified by `pull-request-repo` is automatically allowed - you don't need to list it in `allowed-pull-request-repos`. Use `allowed-pull-request-repos` to specify additional repositories where PRs can be created.
+
+Use `base-branch` to specify which branch in the target repository the pull request should target. When omitted, the target repository's actual default branch is used automatically. Only relevant when `pull-request-repo` is configured.
+
+## Assignee Filtering
+
+When an `allowed` list is configured, existing agent assignees not in the list are removed while regular user assignees are preserved.
+
+## Authentication
+
+This safe output requires a fine-grained PAT to authenticate the agent assignment operation. The default `GITHUB_TOKEN` lacks the necessary permissions.
+
+**Using a Personal Access Token (PAT)**:
+
+The required token type and permissions depend on whether you own the repository or an organization owns it.
+
+1. **Create the PAT**:
+
+ For User-owned Repositories, [create a fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
+ - **Resource owner**: Your user account
+ - **Repository access**: "Public repositories" or select specific repos
+ - **Repository permissions**:
+ - Actions: Write
+ - Contents: Write
+ - Issues: Write
+ - Pull requests: Write
+
+ For Organization-owned Repositories: [create a fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
+ - **Resource owner**: The organization that owns the repository
+ - **Repository access**: Select the specific repositories that will use the workflow
+ - **Repository permissions**:
+ - Actions: Write
+ - Contents: Write
+ - Issues: Write
+ - Pull requests: Write
+
+2. Add to repository secrets:
+
+ ```bash wrap
+ gh aw secrets set GH_AW_AGENT_TOKEN --value "YOUR_AGENT_PAT"
+ ```
+
+**Using a GitHub App**:
+
+Alternatively, you can use a GitHub App with appropriate permissions instead of a PAT for enhanced security.
+
+**Using a magic secret**:
+
+Alternatively, you can set the magic secret `GH_AW_AGENT_TOKEN` to a suitable PAT (see the above guide for creating one). This secret name is known to GitHub Agentic Workflows and does not need to be explicitly referenced in your workflow.
+
+
+
+## Related Documentation
+
+- [Safe Outputs Reference](/gh-aw/reference/safe-outputs/) - All safe output configurations
+- [Authentication Reference](/gh-aw/reference/auth/) - All tokens and secrets
+- [IssueOps](/gh-aw/patterns/issue-ops/) - Issue-triggered workflow patterns
diff --git a/docs/src/content/docs/reference/auth-projects.mdx b/docs/src/content/docs/reference/auth-projects.mdx
new file mode 100644
index 0000000000..c4ff4bf594
--- /dev/null
+++ b/docs/src/content/docs/reference/auth-projects.mdx
@@ -0,0 +1,106 @@
+---
+title: Authentication (Projects)
+description: How to authenticate GitHub Projects operations in agentic workflows
+sidebar:
+ order: 651
+---
+
+import { Card, CardGrid } from '@astrojs/starlight/components';
+import Video from '../../../components/Video.astro';
+
+Project operations require additional authentication since the default `GITHUB_TOKEN` lacks necessary permissions for the Projects API. You can authenticate using either a Personal Access Token (PAT) or a GitHub App token.
+
+## Using a Personal Access Token (PAT)
+
+### 1. Create the PAT
+
+**For User-owned Projects**:
+
+Create a [classic PAT](https://github.com/settings/tokens/new) with scopes:
+- `project` (required for user Projects)
+- `repo` (required if accessing private repositories)
+
+
+
+**For Organization-owned Projects (v2)**:
+
+Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
+- **Repository access**: Select specific repos that will use the workflow
+- **Repository permissions**:
+ - Contents: Read
+ - Issues: Read (if needed for issue-triggered workflows)
+ - Pull requests: Read (if needed for PR-triggered workflows)
+- **Organization permissions** (must be explicitly granted):
+ - Projects: Read & Write (required for updating org Projects)
+- **Important**: You must explicitly grant organization access during token creation
+
+
+
+### 2. Add the token to repository secrets
+
+```bash wrap
+gh aw secrets set MY_PROJECT_TOKEN --value "YOUR_PROJECT_PAT"
+```
+
+### 3. Configure in your workflow frontmatter
+
+```yaml wrap
+safe-outputs:
+ update-project:
+ github-token: ${{ secrets.MY_PROJECT_TOKEN }}
+
+tools:
+ github:
+ toolsets: [default, projects]
+ github-token: ${{ secrets.MY_PROJECT_TOKEN }}
+```
+
+## Using a GitHub App
+
+Alternatively, you can use a GitHub App for enhanced security. See [Using a GitHub App for Authentication](/gh-aw/reference/auth/#using-a-github-app-for-authentication) for complete setup instructions. Once set up, reference the app token in your workflow using `app:` on safe outputs and tools.
+
+## Using a magic secret
+
+Alternatively, you can set the magic GitHub Actions secret `GH_AW_PROJECT_GITHUB_TOKEN` to a suitable PAT (see the above guide for creating a suitable PAT). This secret name is known to GitHub Agentic Workflows and does not need to be explicitly referenced in your workflow.
+
+## Debugging: who owns a GitHub token?
+
+Ownership affects token requirements for projects. If the owner is your personal username, it is user-owned. If the owner is an organization, it is org-owned and managed with shared roles and access controls.
+
+To confirm ownership, check the owner name and avatar at the top of the page or in the URL (`github.com/owner-name/...`). Clicking the owner takes you to a personal profile or an organization page, which confirms it instantly. Here are examples of both (left: user-owned, right: org-owned):
+
+
+
+
+
+
+
+
+ Avatar shows a personal profile icon, URL includes username
+
+
+
+
+
+
+
+
+ Avatar shows organization icon, URL includes org name
+
+
+
+## Related
+
+- [Authentication](/gh-aw/reference/auth/) - General authentication reference
+- [ProjectOps](/gh-aw/patterns/project-ops/) - Automate GitHub Projects with AI-powered workflows
+- [Safe Outputs Reference](/gh-aw/reference/safe-outputs/#project-board-updates-update-project) - Project update configuration
diff --git a/docs/src/content/docs/reference/auth.mdx b/docs/src/content/docs/reference/auth.mdx
index 2d742ec814..d876cea7c8 100644
--- a/docs/src/content/docs/reference/auth.mdx
+++ b/docs/src/content/docs/reference/auth.mdx
@@ -6,16 +6,11 @@ sidebar:
disable-agentic-editing: true
---
-import { Card, CardGrid } from '@astrojs/starlight/components';
import Video from '../../../components/Video.astro';
-This page describes authentication settings for GitHub Agentic Workflows, including:
+This page describes authentication settings for GitHub Agentic Workflows.
-- GitHub Actions secrets, API Keys and tokens required for different AI engines
-- GitHub tokens for GitHub tools and safe outputs
-- Using a GitHub App as an alternative for authorization
-
-## Which GitHub Actions secrets do I need?
+## Authenticating Your Coding Agent (AI Engine)
You will need one of the following GitHub Actions secrets configured in your repository to authenticate the AI engine you choose:
@@ -24,13 +19,25 @@ You will need one of the following GitHub Actions secrets configured in your rep
- **Codex by OpenAI** – Add [`OPENAI_API_KEY`](#openai_api_key)
- **Gemini by Google** – Add [`GEMINI_API_KEY`](#gemini_api_key)
-Depending on what your workflow needs to do, you may need additional GitHub tokens added as repository secrets:
+Most workflows will run without any additional secrets or additional authentication.
+
+## Additional Authentication
+
+Some workflows need additional authentication. These can be tokens added as secrets and referenced in your workflow, or GitHub App can be used.
+
+Workflows using the following **read** operations from GitHub require [Additional Authentication for GitHub Tools](/gh-aw/reference/github-tools/#additional-authentication-for-github-tools), via either a secret containing a PAT or GitHub App:
+- **Read from multiple repositories**
+- **Read from projects**
+- **GitHub tools remote mode**
+- **GitHub tools lockdown mode**
-- [**Cross-repo read/write access**](#gh_aw_github_token)
-- [**Trigger CI on PRs created by workflows**](#gh_aw_ci_trigger_token)
-- [**Assign Copilot coding agent to issues/PRs**](#gh_aw_agent_token)
-- [**GitHub Projects operations**](#gh_aw_project_github_token)
-- [**Remote GitHub tools mode or lockdown**](#gh_aw_github_mcp_server_token)
+Workflows using the following features of [Safe Outputs](/gh-aw/reference/safe-outputs/) require additional authentication, via either a secret containing a PAT or GitHub App:
+- [**Safe outputs writing cross-repo**](/gh-aw/reference/safe-outputs/#cross-repository-operations)
+- [**Safe outputs assigning Copilot coding agent to issues/PRs**](/gh-aw/reference/assign-to-copilot/)
+- [**Safe outputs updating GitHub Projects**](/gh-aw/reference/auth-projects/)
+- [**Safe outputs triggering CI on PRs**](/gh-aw/reference/triggering-ci/)
+
+Workflows using custom MCP tools or safe outputs may require additional authentication depending on the operations performed.
## How do I add a GitHub Actions secret to my repository?
@@ -61,9 +68,9 @@ If you're working in Codespaces, use the GitHub UI method below to add secrets.
-## GitHub Actions secrets and tokens
+## GitHub Actions secrets for AI engines
-A reference for all GitHub Actions secrets and tokens used by GitHub Agentic Workflows, including when they are needed and how to set them up.
+A reference for all GitHub Actions secrets used by GitHub Agentic Workflows for AI engine authentication:
### `COPILOT_GITHUB_TOKEN`
@@ -150,249 +157,6 @@ See also [Using Gemini](/gh-aw/reference/engines/#using-google-gemini-cli) for a
---
-### `GH_AW_GITHUB_TOKEN`
-
-This token is used to give added capabilities to multiple operations within a workflow.
-
-**When Required**:
-
-- **Safe outputs must perform cross-repository operations**: Required for accessing other repositories beyond the current one.
-
-**Setup**:
-
-1. Create a GitHub Personal Access Token (PAT) with the necessary scopes based on your workflow's operations. For example, if your workflow interacts with issues and pull requests, you would need `repo` scope for private repositories or `public_repo` for public repositories.
-
-2. Add it to your repository secrets, either by CLI or GitHub UI:
-
- ```bash wrap
- gh aw secrets set GH_AW_GITHUB_TOKEN --value ""
- ```
-
-3. The token will be used implicitly by the name of the secret. If you have used a different name, configure in your workflow frontmatter for specific safe outputs:
-
- ```bash wrap
- github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
- ```
-
-Note that using `GH_AW_GITHUB_TOKEN` replaces the default behaviour of GitHub Agentic Workflows (which arranges temporary `GITHUB_TOKEN` GitHub Actions tokens appropriate to the `permissions:` you have declared).
-
----
-
-### `GH_AW_GITHUB_MCP_SERVER_TOKEN`
-
-This token is used to give the GitHub tools used by your workflow additional capabilities.
-
-**When Required**:
-
-- Read access to GitHub org or user information
-- Read access to other private repos
-- GitHub tools `lockdown: true`
-- GitHub tools `mode: remote`
-
-**Setup**:
-
-1. Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
-
- - **Repository access**:
- - Select specific repos or "All repositories"
- - **Repository permissions** (based on your GitHub tools usage):
- - Contents: Read (minimum for toolset: repos)
- - Issues: Read (for toolset: issues)
- - Pull requests: Read (for toolset: pull_requests)
- - Adjust based on the toolsets you configure in your workflow
-
-2. Add it to your repository secrets, either by CLI or GitHub UI:
-
- ```bash wrap
- gh aw secrets set GH_AW_GITHUB_MCP_SERVER_TOKEN --value ""
- ```
-
-3. Configure in your workflow frontmatter:
-
- ```yaml wrap
- tools:
- github:
- github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
- ```
-
----
-
-### `GH_AW_CI_TRIGGER_TOKEN`
-
-This token is used to trigger CI workflow runs on pull requests created by your workflow. See [Triggering CI](/gh-aw/reference/triggering-ci/) for more details.
-
-**When Required**:
-
-- To trigger CI checks on PRs created using `create-pull-request` or `push-to-pull-request-branch` safe outputs.
-
-**Setup**:
-
-1. Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with `Contents: Read & Write` scoped to the relevant repositories where pull requests will be created.
-
-2. Add it to your repository secrets, either by CLI or GitHub UI:
-
- ```bash wrap
- gh aw secrets set GH_AW_CI_TRIGGER_TOKEN --value ""
- ```
-
-3. Configure in your workflow frontmatter:
-
- ```yaml wrap
- safe-outputs:
- create-pull-request:
- github-token-for-extra-empty-commit: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }}
- ```
-
- or
-
- ```yaml wrap
- safe-outputs:
- push-to-pull-request-branch:
- github-token-for-extra-empty-commit: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }}
- ```
-
-
-
----
-
-### `GH_AW_PROJECT_GITHUB_TOKEN`
-
-This token is used to authenticate GitHub API operations related to [GitHub Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects). It is needed because the default `GITHUB_TOKEN` cannot access the Projects API.
-
-**When Required**:
-
-- Your workflow requires read access to projects
-- Your workflow uses safe outputs to update or create projects
-
-**Setup**:
-
-1. Create a token. The required token type depends on whether you're working with **user-owned** or **organization-owned** Projects:
-
- **For User-owned Projects**:
-
- Create a [classic PAT](https://github.com/settings/tokens/new) with scopes:
- - `project` (required for user Projects)
- - `repo` (required if accessing private repositories)
-
- **For Organization-owned Projects (v2)**:
-
- Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
- - **Repository access**: Select specific repos that will use the workflow
- - **Repository permissions**:
- - Contents: Read
- - Issues: Read (if needed for issue-triggered workflows)
- - Pull requests: Read (if needed for PR-triggered workflows)
- - **Organization permissions** (must be explicitly granted):
- - Projects: Read & Write (required for updating org Projects)
- - **Important**: You must explicitly grant organization access during token creation
-
-2. Add your token to repository secrets, either by CLI or GitHub UI:
-
- ```bash wrap
- gh aw secrets set GH_AW_PROJECT_GITHUB_TOKEN --value "YOUR_PROJECT_PAT"
- ```
-
-3. Configure in your workflow frontmatter:
-
- ```yaml wrap
- safe-outputs:
- update-project:
- github-token: ${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}
-
- tools:
- github:
- toolsets: [default, projects]
- github-token: ${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}
- ```
-
-**For User-owned Projects**:
-
-
-
-**For Organization-owned Projects**:
-
-
-
----
-
-### `GH_AW_AGENT_TOKEN`
-
-This token is used to programmatically assign the GitHub platform's asynchronous [Copilot coding agent](https://docs.github.com/en/copilot/concepts/agents/coding-agent/about-coding-agent) to issues or pull requests.
-
-**When Required**:
-
-- `assign-to-agent:` safe output, or
-- `assignees: copilot` in `create-issue` safe output
-
-**Setup**:
-
-The required token type and permissions depend on whether you own the repository or an organization owns it:
-
-**For User-owned Repositories**:
-
-1. Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
- - **Resource owner**: Your user account
- - **Repository access**: "Public repositories" or select specific repos
- - **Repository permissions**:
- - Actions: Write
- - Contents: Write
- - Issues: Write
- - Pull requests: Write
-
-**For Organization-owned Repositories**:
-
-
-
-When an organization owns the repository, you need a fine-grained PAT with the resource owner set to the organization:
-
-1. Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
- - **Resource owner**: The organization that owns the repository
- - **Repository access**: Select the specific repositories that will use the workflow
- - **Repository permissions**:
- - Actions: Write
- - Contents: Write
- - Issues: Write
- - Pull requests: Write
- - **Important**: You must set the resource owner to the organization during token creation
-
-2. Add to repository secrets:
-
-```bash wrap
-gh aw secrets set GH_AW_AGENT_TOKEN --value "YOUR_AGENT_PAT"
-```
-
-**Token precedence and fallback**:
-
-`GH_AW_AGENT_TOKEN` -> `GH_AW_GITHUB_TOKEN` -> `GITHUB_TOKEN`.
-
-**Resource owner requirements**: The token's resource owner must match the repository ownership:
-- **User-owned repositories**: Use a token where the resource owner is your user account
-- **Organization-owned repositories**: Use a token where the resource owner is the organization
-
-This ensures the token has the appropriate permissions to assign agents to issues and pull requests in the repository.
-
----
-
## Using a GitHub App for Authentication
For enhanced security with short-lived tokens, you may configure a GitHub App instead of using PATs.
diff --git a/docs/src/content/docs/reference/faq.md b/docs/src/content/docs/reference/faq.md
index af4c433718..105d677acf 100644
--- a/docs/src/content/docs/reference/faq.md
+++ b/docs/src/content/docs/reference/faq.md
@@ -181,11 +181,9 @@ See [Network Permissions](/gh-aw/reference/network/) for complete configuration
### What is GitHub lockdown mode and when is it enabled?
-**GitHub lockdown mode** is a security feature that filters content in public repositories to only show issues, pull requests, and comments from users with push access. This protects workflows from processing potentially malicious input from untrusted users.
+[GitHub lockdown mode](/gh-aw/reference/lockdown-mode/) is a security feature that filters content in public repositories to only show issues, pull requests, and comments from users with push access. This protects workflows from processing potentially malicious input from untrusted users.
-Lockdown is **automatically enabled** for public repositories if [`GH_AW_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_token) or [`GH_AW_GITHUB_MCP_SERVER_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_mcp_server_token) is configured. It is not in effect for private or internal repositories.
-
-See [Lockdown Mode](/gh-aw/reference/lockdown-mode/) for detailed configuration guidance and security considerations.
+Lockdown mode is **automatically enabled** for public repositories if [Additional Authentication for GitHub Tools](/gh-aw/reference/github-tools/#additional-authentication-for-github-tools) is configured. It is not in effect for private or internal repositories.
## Configuration & Setup
@@ -305,31 +303,7 @@ See [Pull Request Creation](/gh-aw/reference/safe-outputs/#pull-request-creation
This is expected GitHub Actions security behavior. Pull requests created using the default `GITHUB_TOKEN` or by the GitHub Actions bot user **do not trigger workflow runs** on `pull_request`, `pull_request_target`, or `push` events. This is a [GitHub Actions security feature](https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow) designed to prevent accidental recursive workflow execution.
-GitHub Actions prevents the `GITHUB_TOKEN` from triggering new workflow runs to avoid infinite loops and uncontrolled automation chains. Without this protection, a workflow could create a PR, which triggers another workflow, which creates another PR, and so on indefinitely.
-
-If you need CI checks to run on PRs created by agentic workflows, you have several options:
-
-**Option 1: Use `github-token-for-extra-empty-commit` (Recommended)**
-
-Add a `github-token-for-extra-empty-commit` to your `create-pull-request` or `push-to-pull-request-branch` safe output. This pushes an empty commit using a different token after PR creation/push, which triggers CI events without changing the overall PR authorization.
-
-```yaml wrap
-safe-outputs:
- create-pull-request:
- github-token-for-extra-empty-commit: ${{ secrets.CI_TRIGGER_PAT }}
-```
-
-See [Triggering CI](/gh-aw/reference/triggering-ci/) for details.
-
-**Option 2: Use different authorization for the entire safe output**
-
-Configure your [`create-pull-request` safe output](/gh-aw/reference/safe-outputs/#pull-request-creation-create-pull-request) to use a PAT or a GitHub App for all operations. This allows PR creation to trigger CI workflows, but changes the authorization for the entire PR creation process. The user or app associated with the token will be the author of the PR.
-
-```yaml wrap
-safe-outputs:
- create-pull-request:
- github-token: ${{ secrets.CI_USER_PAT }}
-```
+See [Triggering CI](/gh-aw/reference/triggering-ci/) for details on how to configure workflows to run CI checks on PRs created by agentic workflows.
## Workflow Design
diff --git a/docs/src/content/docs/reference/frontmatter.md b/docs/src/content/docs/reference/frontmatter.md
index 6760d1e982..c354b4c8a9 100644
--- a/docs/src/content/docs/reference/frontmatter.md
+++ b/docs/src/content/docs/reference/frontmatter.md
@@ -128,13 +128,6 @@ plugins:
github-token: ${{ secrets.CUSTOM_PLUGIN_TOKEN }}
```
-**Token precedence** for plugin installation (highest to lowest):
-
-1. Custom `plugins.github-token` from object format
-2. `${{ secrets.GH_AW_PLUGINS_TOKEN }}`
-3. [`${{ secrets.GH_AW_GITHUB_TOKEN }}`](/gh-aw/reference/auth/#gh_aw_github_token)
-4. `${{ secrets.GITHUB_TOKEN }}` (default)
-
Each plugin repository must be specified in `org/repo` format. The compiler generates installation steps that run after the engine CLI is installed but before workflow execution begins.
### Runtimes (`runtimes:`)
diff --git a/docs/src/content/docs/reference/github-tools.md b/docs/src/content/docs/reference/github-tools.md
new file mode 100644
index 0000000000..1f639b63d8
--- /dev/null
+++ b/docs/src/content/docs/reference/github-tools.md
@@ -0,0 +1,131 @@
+---
+title: GitHub Tools
+description: Configure GitHub API operations, toolsets, modes, and authentication for your agentic workflows
+sidebar:
+ order: 710
+---
+
+Configure GitHub API operations available to your workflow through the Model Context Protocol (MCP).
+
+```yaml wrap
+tools:
+ github: # Default read-only access
+ github:
+ toolsets: [repos, issues, pull_requests] # Recommended: toolset groups
+ mode: remote # "local" (Docker) or "remote" (hosted)
+ read-only: true # Read-only operations
+ github-token: "${{ secrets.CUSTOM_PAT }}" # Custom token
+```
+
+## GitHub Toolsets
+
+Enable specific API groups to improve tool selection and reduce context size:
+
+```yaml wrap
+tools:
+ github:
+ toolsets: [repos, issues, pull_requests, actions]
+```
+
+**Available**: `context`, `repos`, `issues`, `pull_requests`, `users`, `actions`, `code_security`, `discussions`, `labels`, `notifications`, `orgs`, `projects`, `gists`, `search`, `dependabot`, `experiments`, `secret_protection`, `security_advisories`, `stargazers`
+
+**Default**: `context`, `repos`, `issues`, `pull_requests`, `users`
+
+Note `toolsets: [default]` expands to `[context, repos, issues, pull_requests]` (excluding `users`) since `GITHUB_TOKEN` lacks user permissions. Use a PAT for the full default set.
+
+Key toolsets: **context** (user/team info), **repos** (repository operations, code search, commits, releases), **issues** (issue management, comments, reactions), **pull_requests** (PR operations), **actions** (workflows, runs, artifacts), **code_security** (scanning alerts), **discussions**, **labels**.
+
+## Remote vs Local Mode
+
+**Remote Mode**: Use hosted MCP server for faster startup (no Docker). Requires [Additional Authentication for GitHub Tools](/gh-aw/reference/github-tools/#additional-authentication-for-github-tools):
+
+```yaml wrap
+tools:
+ github:
+ mode: remote # Default: "local" (Docker)
+ github-token: ${{ secrets.CUSTOM_PAT }} # Required for remote mode
+```
+
+**Local Mode**: Use Docker container for isolation. Requires `docker` tool and appropriate permissions:
+
+```yaml wrap
+tools:
+ docker:
+ github:
+ mode: local
+```
+
+## Lockdown Mode for Public Repositories
+
+Lockdown Mode is a security feature that filters public repository content to only show issues, PRs, and comments from users with push access. Automatically enabled for public repositories when using custom tokens. See [Lockdown Mode](/gh-aw/reference/lockdown-mode/) for complete documentation.
+
+```yaml wrap
+tools:
+ github:
+ lockdown: true # Force enable (automatic for public repos)
+ lockdown: false # Disable (for workflows processing all user input)
+```
+
+## Additional Authentication for GitHub Tools
+
+In some circumstances you must use a GitHub PAT or GitHub app to give the GitHub tools used by your workflow additional capabilities.
+
+This authentication relates to **reading** information from GitHub. Additional authentication to write to GitHub is handled separately through various [Safe Outputs](/gh-aw/reference/safe-outputs/).
+
+**When Required**:
+
+- Read access to GitHub org or user information
+- Read access to other private repos
+- Read access to projects
+- GitHub tools [Lockdown Mode](/gh-aw/reference/lockdown-mode/)
+- GitHub tools [Remote Mode](#remote-vs-local-mode)
+
+**Using a Personal Access Token (PAT)**:
+
+If additional authentication is required, one way is to create a fine-grained PAT with appropriate permissions, add it as a repository secret, and reference it in your workflow:
+
+1. Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with:
+
+ - **Repository access**:
+ - Select specific repos or "All repositories"
+ - **Repository permissions** (based on your GitHub tools usage):
+ - Contents: Read (minimum for toolset: repos)
+ - Issues: Read (for toolset: issues)
+ - Pull requests: Read (for toolset: pull_requests)
+ - Projects: Read (for toolset: projects)
+ - Lockdown mode: no additional permissions required
+ - Remote mode: no additional permissions required
+ - Adjust based on the toolsets you configure in your workflow
+ - **Organization permissions** (if accessing org-level info):
+ - Members: Read (for org member info in context)
+ - Teams: Read (for team info in context)
+ - Adjust based on the toolsets you configure in your workflow
+
+2. Add it to your repository secrets, either by CLI or GitHub UI:
+
+ ```bash wrap
+ gh aw secrets set MY_PAT_FOR_GITHUB_TOOLS --value ""
+ ```
+
+3. Configure in your workflow frontmatter:
+
+ ```yaml wrap
+ tools:
+ github:
+ github-token: ${{ secrets.MY_PAT_FOR_GITHUB_TOOLS }}
+ ```
+
+**Using a GitHub App**:
+
+Alternatively, you can use a GitHub App for enhanced security. See [Using a GitHub App for Authentication](/gh-aw/reference/auth/#using-a-github-app-for-authentication) for complete setup instructions.
+
+**Using a magic secret**:
+
+Alternatively, you can set the magic secret `GH_AW_GITHUB_MCP_SERVER_TOKEN` to a suitable PAT (see the above guide for creating one). This secret name is known to GitHub Agentic Workflows and does not need to be explicitly referenced in your workflow.
+
+## Related Documentation
+
+- [Tools Reference](/gh-aw/reference/tools/) - All tool configurations
+- [Authentication Reference](/gh-aw/reference/auth/) - Token setup and permissions
+- [Lockdown Mode](/gh-aw/reference/lockdown-mode/) - Public repository security
+- [MCPs Guide](/gh-aw/guides/mcps/) - Model Context Protocol setup
diff --git a/docs/src/content/docs/reference/lockdown-mode.md b/docs/src/content/docs/reference/lockdown-mode.md
index 7c2a4835fb..cba82f2caf 100644
--- a/docs/src/content/docs/reference/lockdown-mode.md
+++ b/docs/src/content/docs/reference/lockdown-mode.md
@@ -7,8 +7,12 @@ sidebar:
**GitHub lockdown mode** is [a security feature of the GitHub MCP server](https://github.com/github/github-mcp-server/blob/main/docs/server-configuration.md#lockdown-mode) that filters content in public repositories to only surface items (issues, pull requests, comments, discussions, etc.) from users with **push access** to the repository. This protects agentic workflows from processing potentially malicious or misleading content from untrusted users.
-> [!TIP]
-> **Enabling Lockdown Mode**: Set `lockdown: true` in your workflow frontmatter and configure [`GH_AW_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_token) as a repository secret. For public repositories, this provides enhanced security against untrusted input.
+To enable lockdown mode for your workflow:
+
+1. **Set `lockdown: true` in your workflow frontmatter**
+2. **Configure [Additional Authentication for GitHub Tools](/gh-aw/reference/github-tools/#additional-authentication-for-github-tools)
+
+Lockdown Mode is **automatically enabled** for public repositories if [Additional Authentication for GitHub Tools](/gh-aw/reference/github-tools/#additional-authentication-for-github-tools) is configured. It is not in effect for private or internal repositories.
## Security Benefits
@@ -27,6 +31,7 @@ Without lockdown, an attacker could:
### Context Poisoning
Attackers could flood public repositories with spam issues to:
+
- Overwhelm the AI context window with noise
- Manipulate AI decisions through volume of malicious suggestions
- Exhaust rate limits or credits
@@ -36,20 +41,14 @@ Attackers could flood public repositories with spam issues to:
### Social Engineering
Malicious users could craft issues that:
+
- Impersonate maintainers
- Request sensitive information
- Trick AI into revealing secrets or internal data
**With lockdown**: Only verified contributors can interact with workflows.
-## Configuration
-
-### Enabling Lockdown Mode
-
-To enable lockdown mode for your workflow:
-
-1. **Set `lockdown: true` in your workflow frontmatter**
-2. **Configure `GH_AW_GITHUB_TOKEN` as a repository secret** (see [Authentication](/gh-aw/reference/auth/#gh_aw_github_token))
+## Example
```yaml wrap
---
@@ -58,6 +57,7 @@ engine: copilot
tools:
github:
lockdown: true
+ github-token: ${{ secrets.CUSTOM_TOKEN }} # Required for lockdown, and causes lockdown in public repos
mode: remote
toolsets: [repos, issues, pull_requests]
---
@@ -70,13 +70,7 @@ tools:
gh aw secrets set GH_AW_GITHUB_TOKEN --value "YOUR_FINE_GRAINED_PAT"
```
-**Requirements**:
-
-- `GH_AW_GITHUB_TOKEN` must be configured as a repository secret
-- The token requires appropriate permissions (Contents: Read, Issues: Read, Pull requests: Read)
-- Without `GH_AW_GITHUB_TOKEN` or a similar token, workflows with `lockdown: true` will fail at runtime
-
-### Disabling Lockdown Mode
+## Disabling Lockdown Mode
Explicitly disable lockdown for workflows designed to process content from all users:
@@ -86,9 +80,6 @@ tools:
lockdown: false # Explicitly disable (see "When to Disable" below)
```
-> [!WARNING]
-> **Security Consideration**: Setting `lockdown: false` in public repositories allows workflows to process content from any GitHub user. Only use this for workflows specifically designed to handle untrusted input safely.
-
## When to Disable Lockdown
If working in a public repository, it is recommended that you use an explicit `lockdown: true` or `lockdown: false`.
diff --git a/docs/src/content/docs/reference/safe-outputs.md b/docs/src/content/docs/reference/safe-outputs.md
index af1c57d971..957a2a81b9 100644
--- a/docs/src/content/docs/reference/safe-outputs.md
+++ b/docs/src/content/docs/reference/safe-outputs.md
@@ -345,7 +345,7 @@ safe-outputs:
**Target**: `"triggering"` (requires PR event), `"*"` (any PR), or number (specific PR).
-Use `reviewers: [copilot]` to assign the Copilot PR reviewer bot. This uses the same token resolution as Copilot agent assignment: `github-token:`, [`GH_AW_AGENT_TOKEN`](/gh-aw/reference/auth/#gh_aw_agent_token) (or [`GH_AW_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_token), falling back to `GITHUB_TOKEN`).
+Use `reviewers: [copilot]` to assign the Copilot PR reviewer bot. See [Assign to Agent](/gh-aw/reference/assign-to-copilot/).
### Assign Milestone (`assign-milestone:`)
@@ -440,7 +440,7 @@ Agent output includes `parent_issue_number` and `sub_issue_number`. Validation e
### Project Creation (`create-project:`)
-Creates new GitHub Projects V2 boards. Requires PAT or GitHub App token ([`GH_AW_PROJECT_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_project_github_token))-default `GITHUB_TOKEN` lacks Projects v2 access. Supports optional view configuration to create custom project views at creation time.
+Creates new GitHub Projects V2 boards. Requires PAT or GitHub App token ([`GH_AW_PROJECT_GITHUB_TOKEN`](/gh-aw/reference/auth-projects/))-default `GITHUB_TOKEN` lacks Projects v2 access. Supports optional view configuration to create custom project views at creation time.
```yaml wrap
safe-outputs:
@@ -496,7 +496,7 @@ Optionally include `item_url` (GitHub issue URL) to add the issue as the first p
### Project Board Updates (`update-project:`)
-Manages GitHub Projects boards. Requires PAT or GitHub App token ([`GH_AW_PROJECT_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_project_github_token))-default `GITHUB_TOKEN` lacks Projects v2 access. Update-only by default; set `create_if_missing: true` to create boards (requires appropriate token permissions).
+Manages GitHub Projects boards. Requires PAT or GitHub App token ([`GH_AW_PROJECT_GITHUB_TOKEN`](/gh-aw/reference/auth-projects/))-default `GITHUB_TOKEN` lacks Projects v2 access. Update-only by default; set `create_if_missing: true` to create boards (requires appropriate token permissions).
```yaml wrap
safe-outputs:
@@ -594,7 +594,7 @@ Views are created automatically during workflow execution. The workflow must inc
### Project Status Updates (`create-project-status-update:`)
-Creates status updates on GitHub Projects boards to communicate progress, findings, and trends. Status updates appear in the project's Updates tab and provide a historical record of execution. Requires PAT or GitHub App token ([`GH_AW_PROJECT_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_project_github_token))-default `GITHUB_TOKEN` lacks Projects v2 access.
+Creates status updates on GitHub Projects boards to communicate progress, findings, and trends. Status updates appear in the project's Updates tab and provide a historical record of execution. Requires PAT or GitHub App token ([`GH_AW_PROJECT_GITHUB_TOKEN`](/gh-aw/reference/auth-projects/))-default `GITHUB_TOKEN` lacks Projects v2 access.
```yaml wrap
safe-outputs:
@@ -1104,13 +1104,11 @@ To respect GitHub API rate limits, the handler automatically enforces a 5-second
### Agent Session Creation (`create-agent-session:`)
-Creates Copilot coding agent sessions. Requires [`COPILOT_GITHUB_TOKEN`](/gh-aw/reference/auth/#copilot_github_token) or [`GH_AW_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_token) PAT-default `GITHUB_TOKEN` lacks permissions.
+Creates Copilot coding agent sessions.
### Assign to Agent (`assign-to-agent:`)
-Programmatically assigns GitHub Copilot coding agent to **existing** issues or pull requests through workflow automation. This safe output automates the [standard GitHub workflow for assigning issues to Copilot](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-a-pr#assigning-an-issue-to-copilot). Requires fine-grained PAT with actions, contents, issues, pull requests write access stored as [`GH_AW_AGENT_TOKEN`](/gh-aw/reference/auth/#gh_aw_agent_token), or GitHub App token. Supported agents: `copilot` (`copilot-swe-agent`).
-
-Auto-resolves target from workflow context (issue/PR events) when `issue_number` or `pull_number` not explicitly provided. Restrict with `allowed` list. Target: `"triggering"` (default), `"*"` (any), or number.
+Programmatically assigns GitHub Copilot coding agent to **existing** issues or pull requests through workflow automation. This safe output automates the [standard GitHub workflow for assigning issues to Copilot](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/create-a-pr#assigning-an-issue-to-copilot).
```yaml wrap
safe-outputs:
@@ -1129,29 +1127,9 @@ safe-outputs:
github-token: ${{ secrets.SOME_CUSTOM_TOKEN }} # optional custom token for permissions
```
-**Target Issue or Pull Request:**
-
-- `target: "triggering"` - Auto-resolves from `github.event.issue.number` or `github.event.pull_request.number`
-- `target: "*"` - Requires explicit `issue_number` or `pull_number` in agent output
-- `target: "123"` - Always uses issue/PR #123
-
-**Cross-Repository PR Creation:**
-
-The `pull-request-repo` parameter allows you to create pull requests in a different repository than where the issue lives. This is useful when:
-
-- Issues are tracked in a central repository but code lives in separate repositories
-- You want to separate issue tracking from code repositories
-
-When `pull-request-repo` is configured, Copilot will create the pull request in the specified repository instead of the issue's repository. The issue repository is determined by `target-repo` or defaults to the workflow's repository.
-
-The repository specified by `pull-request-repo` is automatically allowed - you don't need to list it in `allowed-pull-request-repos`. Use `allowed-pull-request-repos` to specify additional repositories where PRs can be created.
-
-Use `base-branch` to specify which branch in the target repository the pull request should target. When omitted, the target repository's actual default branch is used automatically. Only relevant when `pull-request-repo` is configured.
-
-**Assignee Filtering:**
-When `allowed` list is configured, existing agent assignees not in the list are removed while regular user assignees are preserved.
+See **[Assign to Copilot](/gh-aw/reference/assign-to-copilot/)** for complete configuration options and authorization setup.
-Use `assign-to-agent` when you need to programmatically assign agents to **existing** issues or PRs through workflow automation. If you're creating new issues and want to assign an agent immediately, use `assignees: copilot` in your [`create-issue`](#issue-creation-create-issue) configuration instead.
+If you're creating new issues and want to assign an agent immediately, use `assignees: copilot` in your [`create-issue`](#issue-creation-create-issue) configuration instead.
### Assign to User (`assign-to-user:`)
@@ -1184,13 +1162,13 @@ safe-outputs:
## Cross-Repository Operations
-Most safe outputs support `target-repo`. This will generally require an authorization option (`github-token` or `app:`)-to take effect.
+Most safe outputs support `target-repo`. This will generally require additional authentication (`github-token` or `app:`) to take effect.
```yaml wrap
safe-outputs:
create-issue:
target-repo: "org/tracking-repo"
- github-token: ${{ secrets.CROSS_REPO_PAT }}
+ github-token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}
```
## Global Configuration Options
diff --git a/docs/src/content/docs/reference/tools.md b/docs/src/content/docs/reference/tools.md
index 2139d04a0c..67f9b51a42 100644
--- a/docs/src/content/docs/reference/tools.md
+++ b/docs/src/content/docs/reference/tools.md
@@ -52,75 +52,9 @@ tools:
## GitHub Tools (`github:`)
-Configure GitHub API operations.
+Configure GitHub API operations including toolsets, remote/local modes, and authentication.
-```yaml wrap
-tools:
- github: # Default read-only access
- github:
- toolsets: [repos, issues, pull_requests] # Recommended: toolset groups
- mode: remote # "local" (Docker) or "remote" (hosted)
- read-only: true # Read-only operations
- github-token: "${{ secrets.CUSTOM_PAT }}" # Custom token
-```
-
-### GitHub Toolsets
-
-Enable specific API groups to improve tool selection and reduce context size:
-
-```yaml wrap
-tools:
- github:
- toolsets: [repos, issues, pull_requests, actions]
-```
-
-**Available**: `context`, `repos`, `issues`, `pull_requests`, `users`, `actions`, `code_security`, `discussions`, `labels`, `notifications`, `orgs`, `projects`, `gists`, `search`, `dependabot`, `experiments`, `secret_protection`, `security_advisories`, `stargazers`
-
-**Default**: `context`, `repos`, `issues`, `pull_requests`, `users`
-
-> [!NOTE]
-> GitHub Actions Compatibility
-> `toolsets: [default]` expands to `[context, repos, issues, pull_requests]` (excluding `users`) since `GITHUB_TOKEN` lacks user permissions. Use a PAT for the full default set.
-
-Key toolsets: **context** (user/team info), **repos** (repository operations, code search, commits, releases), **issues** (issue management, comments, reactions), **pull_requests** (PR operations), **actions** (workflows, runs, artifacts), **code_security** (scanning alerts), **discussions**, **labels**.
-
-### Remote vs Local Mode
-
-**Remote Mode**: Use hosted MCP server for faster startup (no Docker). Requires [`GH_AW_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_token):
-
-```yaml wrap
-tools:
- github:
- mode: remote # Default: "local" (Docker)
-```
-
-**Local Mode**: Use Docker container for isolation. Requires `docker` tool and appropriate permissions:
-
-```yaml wrap
-tools:
- docker:
- github:
- mode: local
-```
-
-### Lockdown Mode for Public Repositories
-
-Lockdown Mode is a security feature that filters public repository content to only show issues, PRs, and comments from users with push access. Automatically enabled for public repositories when using custom tokens. See [Lockdown Mode](/gh-aw/reference/lockdown-mode/) for complete documentation.
-
-```yaml wrap
-tools:
- github:
- lockdown: true # Force enable (automatic for public repos)
- lockdown: false # Disable (for workflows processing all user input)
-```
-
-### GitHub App Authentication
-
-Use GitHub App tokens for enhanced security with short-lived, automatically-revoked credentials. GitHub Apps provide on-demand token minting at workflow start, automatic revocation at workflow end (even on failure), and permissions automatically mapped from your job's `permissions` field.
-
-See [Using a GitHub App for Authentication](/gh-aw/reference/auth/#using-a-github-app-for-authentication) for complete setup, configuration details, and security benefits.
-
-**Token precedence**: GitHub App → `github-token` → [`GH_AW_GITHUB_MCP_SERVER_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_mcp_server_token) → [`GH_AW_GITHUB_TOKEN`](/gh-aw/reference/auth/#gh_aw_github_token) → `GITHUB_TOKEN`
+See **[GitHub Tools Reference](/gh-aw/reference/github-tools/)** for complete configuration options.
## Playwright Tool (`playwright:`)
@@ -226,6 +160,7 @@ The `registry` field is informational and does not affect server execution. It c
## Related Documentation
+- [GitHub Tools](/gh-aw/reference/github-tools/) - GitHub API operations, toolsets, and modes
- [Safe Inputs](/gh-aw/reference/safe-inputs/) - Define custom inline tools with JavaScript or shell scripts
- [Frontmatter](/gh-aw/reference/frontmatter/) - All frontmatter configuration options
- [Network Permissions](/gh-aw/reference/network/) - Network access control for AI engines
diff --git a/docs/src/content/docs/reference/triggering-ci.mdx b/docs/src/content/docs/reference/triggering-ci.mdx
index 1d5a40e1d2..c1602c7019 100644
--- a/docs/src/content/docs/reference/triggering-ci.mdx
+++ b/docs/src/content/docs/reference/triggering-ci.mdx
@@ -20,14 +20,16 @@ This applies to both [`create-pull-request`](/gh-aw/reference/safe-outputs/#pull
## Solution: Authorize triggering CI on PRs created by workflows
-To trigger CI checks on PRs created by agentic workflows, configure a CI trigger token:
+To trigger CI checks on PRs created by agentic workflows, configure additional authentication for the PR creation safe outputs.
+
+**Using a Personal Access Token (PAT)**:
1. Create a [fine-grained PAT](https://github.com/settings/personal-access-tokens/new) with `Contents: Read & Write` scoped to the relevant repositories where pull requests will be created.
-2. Add the PAT as a repository secret (e.g., `GH_AW_CI_TRIGGER_TOKEN`) using
+2. Add the PAT as a repository secret (e.g., `MY_CI_TRIGGER_PAT`) using
```bash wrap
- gh aw secrets set GH_AW_CI_TRIGGER_TOKEN --value ""
+ gh aw secrets set MY_CI_TRIGGER_PAT --value ""
```
3. Reference it in your workflow:
@@ -35,7 +37,7 @@ To trigger CI checks on PRs created by agentic workflows, configure a CI trigger
```yaml wrap
safe-outputs:
create-pull-request:
- github-token-for-extra-empty-commit: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }}
+ github-token-for-extra-empty-commit: ${{ secrets.MY_CI_TRIGGER_PAT }}
```
or
@@ -43,11 +45,13 @@ To trigger CI checks on PRs created by agentic workflows, configure a CI trigger
```yaml wrap
safe-outputs:
push-to-pull-request-branch:
- github-token-for-extra-empty-commit: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }}
+ github-token-for-extra-empty-commit: ${{ secrets.MY_CI_TRIGGER_PAT }}
```
When configured, the token will be used to push an extra empty commit to the PR branch after PR creation. This will trigger `push` and `pull_request` events normally.
+**Using a GitHub App**:
+
You can also use `app` to authenticate via [the GitHub App configured for the workflow](/gh-aw/reference/auth/).
```yaml wrap
@@ -56,6 +60,10 @@ safe-outputs:
github-token-for-extra-empty-commit: app
```
+**Using a magic secret**:
+
+Alternatively, you can set the magic secret `GH_AW_CI_TRIGGER_TOKEN` to a suitable PAT (see the above guide for creating one). This secret name is known to GitHub Agentic Workflows and does not need to be explicitly referenced in your workflow.
+
## Alternative: Full Token Override
If you want all PR operations to use a different token (not just the CI trigger), use the `github-token` field instead:
diff --git a/docs/src/content/docs/troubleshooting/common-issues.md b/docs/src/content/docs/troubleshooting/common-issues.md
index 1e526d4113..cb7a53aad6 100644
--- a/docs/src/content/docs/troubleshooting/common-issues.md
+++ b/docs/src/content/docs/troubleshooting/common-issues.md
@@ -115,7 +115,7 @@ Compilation hangs indicate circular imports. Remove circular references.
### GitHub Tools Not Available
-Configure using `toolsets:` ([tools reference](/gh-aw/reference/tools/)):
+Configure using `toolsets:` ([tools reference](/gh-aw/reference/github-tools/)):
```yaml wrap
tools:
@@ -125,7 +125,7 @@ tools:
### Toolset Missing Expected Tools
-Check [GitHub Toolsets](/gh-aw/reference/tools/#github-toolsets), combine toolsets (`toolsets: [default, actions]`), or inspect with `gh aw mcp inspect `.
+Check [GitHub Toolsets](/gh-aw/reference/github-tools/), combine toolsets (`toolsets: [default, actions]`), or inspect with `gh aw mcp inspect `.
### MCP Server Connection Failures
diff --git a/docs/src/content/docs/troubleshooting/errors.md b/docs/src/content/docs/troubleshooting/errors.md
index 7aa27a59d2..aeae2870d3 100644
--- a/docs/src/content/docs/troubleshooting/errors.md
+++ b/docs/src/content/docs/troubleshooting/errors.md
@@ -276,7 +276,7 @@ Use an engine with firewall support (e.g., `copilot`), compile without `--strict
After changing from `allowed:` to `toolsets:`, expected tools are not available. The tool may be in a different toolset than expected, or a narrower toolset was chosen.
-Check the [GitHub Toolsets](/gh-aw/reference/tools/#github-toolsets) documentation, use `gh aw mcp inspect ` to see available tools, then add the required toolset.
+Check the [GitHub Toolsets](/gh-aw/reference/github-tools/) documentation, use `gh aw mcp inspect ` to see available tools, then add the required toolset.
### Invalid Toolset Name
diff --git a/pkg/cli/project_command.go b/pkg/cli/project_command.go
index 5fe7300e4e..27f22ea766 100644
--- a/pkg/cli/project_command.go
+++ b/pkg/cli/project_command.go
@@ -63,13 +63,9 @@ func NewProjectNewCommand() *cobra.Command {
The project can optionally be linked to a specific repository.
-Token Requirements:
- The default GITHUB_TOKEN cannot create projects. You must use a PAT with:
- - Classic PAT: 'project' scope (user projects) or 'project' + 'repo' (org projects)
- - Fine-grained PAT: Organization permissions → Projects: Read & Write
-
- Set GH_AW_PROJECT_GITHUB_TOKEN environment variable or configure your gh CLI
- with a token that has the required permissions.
+Authentication Requirements:
+ The default GITHUB_TOKEN cannot create projects. You must use additional authentication.
+ See https://github.github.com/gh-aw/reference/auth/.
Project Setup:
Use --with-project-setup to automatically create:
diff --git a/pkg/parser/schemas/main_workflow_schema.json b/pkg/parser/schemas/main_workflow_schema.json
index f720ab7e21..f7449cf915 100644
--- a/pkg/parser/schemas/main_workflow_schema.json
+++ b/pkg/parser/schemas/main_workflow_schema.json
@@ -5169,7 +5169,7 @@
},
"github-token-for-extra-empty-commit": {
"type": "string",
- "description": "Token used to push an empty commit after PR creation to trigger CI events. Works around the GITHUB_TOKEN limitation where pushes don't trigger workflow runs. Use a secret expression (e.g. '${{ secrets.CI_TOKEN }}') or 'app' for GitHub App auth."
+ "description": "Token used to push an empty commit after PR creation to trigger CI events. Works around the GITHUB_TOKEN limitation where pushes don't trigger workflow runs. Use a secret expression (e.g. '${{ secrets.CI_TOKEN }}'), 'app' for GitHub App auth, or 'default' to use the magic secret GH_AW_CI_TRIGGER_TOKEN."
}
},
"additionalProperties": false,
@@ -6150,7 +6150,7 @@
},
"github-token-for-extra-empty-commit": {
"type": "string",
- "description": "Token used to push an empty commit after pushing changes to trigger CI events. Works around the GITHUB_TOKEN limitation where pushes don't trigger workflow runs. Use a secret expression (e.g. '${{ secrets.CI_TOKEN }}') or 'app' for GitHub App auth."
+ "description": "Token used to push an empty commit after pushing changes to trigger CI events. Works around the GITHUB_TOKEN limitation where pushes don't trigger workflow runs. Use a secret expression (e.g. '${{ secrets.CI_TOKEN }}'), 'app' for GitHub App auth, or 'default' to use the magic secret GH_AW_CI_TRIGGER_TOKEN."
}
},
"additionalProperties": false
diff --git a/pkg/workflow/compiler.go b/pkg/workflow/compiler.go
index 540735e211..57a8ae73f3 100644
--- a/pkg/workflow/compiler.go
+++ b/pkg/workflow/compiler.go
@@ -301,8 +301,8 @@ Ensure proper audience validation and trust policies are configured.`
// (not when implied by "all", as users unlikely intend to use projects with "all")
originalToolsets := workflowData.ParsedTools.GitHub.Toolset.ToStringSlice()
if slices.Contains(originalToolsets, "projects") {
- fmt.Fprintln(os.Stderr, console.FormatInfoMessage("The 'projects' toolset requires a GitHub token with organization Projects permissions."))
- fmt.Fprintln(os.Stderr, console.FormatInfoMessage("See: https://github.github.com/gh-aw/reference/auth/#gh_aw_project_github_token-github-projects-v2"))
+ fmt.Fprintln(os.Stderr, console.FormatInfoMessage("The 'projects' toolset requires additional authentication."))
+ fmt.Fprintln(os.Stderr, console.FormatInfoMessage("See: https://github.github.com/gh-aw/reference/auth-projects/"))
}
}
diff --git a/pkg/workflow/compiler_safe_outputs_job.go b/pkg/workflow/compiler_safe_outputs_job.go
index 6d35201fc5..0c3dc99050 100644
--- a/pkg/workflow/compiler_safe_outputs_job.go
+++ b/pkg/workflow/compiler_safe_outputs_job.go
@@ -419,6 +419,10 @@ func (c *Compiler) buildJobLevelSafeOutputEnvVars(data *WorkflowData, workflowID
if extraEmptyCommitToken == "app" {
envVars["GH_AW_EXTRA_EMPTY_COMMIT_TOKEN"] = "${{ steps.safe-outputs-app-token.outputs.token || '' }}"
consolidatedSafeOutputsJobLog.Print("Extra empty commit using GitHub App token")
+ } else if extraEmptyCommitToken == "default" {
+ // Use the magic GH_AW_CI_TRIGGER_TOKEN secret as fallback
+ envVars["GH_AW_EXTRA_EMPTY_COMMIT_TOKEN"] = getEffectiveCITriggerGitHubToken("")
+ consolidatedSafeOutputsJobLog.Print("Extra empty commit using GH_AW_CI_TRIGGER_TOKEN")
} else if extraEmptyCommitToken != "" {
envVars["GH_AW_EXTRA_EMPTY_COMMIT_TOKEN"] = extraEmptyCommitToken
consolidatedSafeOutputsJobLog.Print("Extra empty commit using explicit token")
diff --git a/pkg/workflow/compiler_safe_outputs_steps_test.go b/pkg/workflow/compiler_safe_outputs_steps_test.go
index e493faca2f..3bd03abde9 100644
--- a/pkg/workflow/compiler_safe_outputs_steps_test.go
+++ b/pkg/workflow/compiler_safe_outputs_steps_test.go
@@ -213,13 +213,13 @@ func TestBuildSharedPRCheckoutSteps(t *testing.T) {
safeOutputs: &SafeOutputsConfig{
CreatePullRequests: &CreatePullRequestsConfig{
BaseSafeOutputConfig: BaseSafeOutputConfig{
- GitHubToken: "${{ secrets.CROSS_REPO_PAT }}",
+ GitHubToken: "${{ secrets.GH_AW_CROSS_REPO_PAT }}",
},
},
},
checkContains: []string{
- "token: ${{ secrets.CROSS_REPO_PAT }}",
- "GIT_TOKEN: ${{ secrets.CROSS_REPO_PAT }}",
+ "token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}",
+ "GIT_TOKEN: ${{ secrets.GH_AW_CROSS_REPO_PAT }}",
},
},
{
@@ -238,15 +238,15 @@ func TestBuildSharedPRCheckoutSteps(t *testing.T) {
safeOutputs: &SafeOutputsConfig{
CreatePullRequests: &CreatePullRequestsConfig{
BaseSafeOutputConfig: BaseSafeOutputConfig{
- GitHubToken: "${{ secrets.CROSS_REPO_PAT }}",
+ GitHubToken: "${{ secrets.GH_AW_CROSS_REPO_PAT }}",
},
TargetRepoSlug: "org/target-repo",
},
},
checkContains: []string{
"repository: org/target-repo",
- "token: ${{ secrets.CROSS_REPO_PAT }}",
- "GIT_TOKEN: ${{ secrets.CROSS_REPO_PAT }}",
+ "token: ${{ secrets.GH_AW_CROSS_REPO_PAT }}",
+ "GIT_TOKEN: ${{ secrets.GH_AW_CROSS_REPO_PAT }}",
`REPO_NAME: "org/target-repo"`,
},
},
diff --git a/pkg/workflow/create_pull_request.go b/pkg/workflow/create_pull_request.go
index f958c16ee6..5f8a31c01d 100644
--- a/pkg/workflow/create_pull_request.go
+++ b/pkg/workflow/create_pull_request.go
@@ -171,6 +171,10 @@ func (c *Compiler) buildCreateOutputPullRequestJob(data *WorkflowData, mainJobNa
if extraEmptyCommitToken == "app" {
customEnvVars = append(customEnvVars, " GH_AW_EXTRA_EMPTY_COMMIT_TOKEN: ${{ steps.safe-outputs-app-token.outputs.token || '' }}\n")
createPRLog.Print("Extra empty commit using GitHub App token")
+ } else if extraEmptyCommitToken == "default" {
+ // Use the magic GH_AW_CI_TRIGGER_TOKEN secret as fallback
+ customEnvVars = append(customEnvVars, fmt.Sprintf(" GH_AW_EXTRA_EMPTY_COMMIT_TOKEN: %s\n", getEffectiveCITriggerGitHubToken("")))
+ createPRLog.Print("Extra empty commit using GH_AW_CI_TRIGGER_TOKEN")
} else {
customEnvVars = append(customEnvVars, fmt.Sprintf(" GH_AW_EXTRA_EMPTY_COMMIT_TOKEN: %s\n", extraEmptyCommitToken))
createPRLog.Printf("Extra empty commit using explicit token")
diff --git a/pkg/workflow/github_token.go b/pkg/workflow/github_token.go
index c8ea9ac81a..b1eb903a8b 100644
--- a/pkg/workflow/github_token.go
+++ b/pkg/workflow/github_token.go
@@ -80,3 +80,19 @@ func getEffectiveProjectGitHubToken(customToken string) string {
tokenLog.Print("Using GH_AW_PROJECT_GITHUB_TOKEN for project operations")
return "${{ secrets.GH_AW_PROJECT_GITHUB_TOKEN }}"
}
+
+// getEffectiveCITriggerGitHubToken returns the GitHub token to use for CI trigger operations
+// (pushing empty commits to trigger workflow runs), with precedence:
+// 1. Custom token passed as parameter (e.g., from github-token-for-extra-empty-commit field)
+// 2. secrets.GH_AW_CI_TRIGGER_TOKEN (recommended token for CI trigger operations)
+// Note: The default GITHUB_TOKEN is NOT included as a fallback because events created with
+// GITHUB_TOKEN do not trigger other workflow runs (GitHub Actions security feature).
+// This is used when pushing an empty commit to trigger CI checks on PRs created by workflows.
+func getEffectiveCITriggerGitHubToken(customToken string) string {
+ if customToken != "" {
+ tokenLog.Print("Using custom CI trigger GitHub token")
+ return customToken
+ }
+ tokenLog.Print("Using GH_AW_CI_TRIGGER_TOKEN for CI trigger operations")
+ return "${{ secrets.GH_AW_CI_TRIGGER_TOKEN }}"
+}
diff --git a/pkg/workflow/github_token_test.go b/pkg/workflow/github_token_test.go
index 11fd1e52ca..b212e717ef 100644
--- a/pkg/workflow/github_token_test.go
+++ b/pkg/workflow/github_token_test.go
@@ -117,3 +117,31 @@ func TestGetEffectiveAgentGitHubToken(t *testing.T) {
})
}
}
+
+func TestGetEffectiveCITriggerGitHubToken(t *testing.T) {
+ tests := []struct {
+ name string
+ customToken string
+ expected string
+ }{
+ {
+ name: "custom token has highest precedence",
+ customToken: "${{ secrets.CUSTOM_CI_TOKEN }}",
+ expected: "${{ secrets.CUSTOM_CI_TOKEN }}",
+ },
+ {
+ name: "default fallback for CI trigger operations",
+ customToken: "",
+ expected: "${{ secrets.GH_AW_CI_TRIGGER_TOKEN }}",
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ result := getEffectiveCITriggerGitHubToken(tt.customToken)
+ if result != tt.expected {
+ t.Errorf("getEffectiveCITriggerGitHubToken() = %q, want %q", result, tt.expected)
+ }
+ })
+ }
+}
diff --git a/pkg/workflow/projects_toolset_warning_test.go b/pkg/workflow/projects_toolset_warning_test.go
index 509d583786..d96bd5541f 100644
--- a/pkg/workflow/projects_toolset_warning_test.go
+++ b/pkg/workflow/projects_toolset_warning_test.go
@@ -38,7 +38,7 @@ tools:
This workflow explicitly uses projects toolset.
`,
shouldWarn: true,
- warningContains: "The 'projects' toolset requires a GitHub token",
+ warningContains: "The 'projects' toolset requires additional authentication",
},
{
name: "Explicit projects with other toolsets should warn",
@@ -55,7 +55,7 @@ tools:
This workflow uses projects among other toolsets.
`,
shouldWarn: true,
- warningContains: "The 'projects' toolset requires a GitHub token",
+ warningContains: "The 'projects' toolset requires additional authentication",
},
{
name: "All toolset should NOT warn about projects",