Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Document fine-grained PAT limitation for organization repositories #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Document fine-grained PAT limitation for organization repositories #65
Changes from all commits
13d695386470730140434File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
GitHub Copilot CLI Action 🤖
A GitHub Action wrapper for the GitHub Copilot CLI that enables AI-powered automation in your workflow files.
Installation
Token Setup
Warning
The default
GITHUB_TOKENdoes NOT have Copilot permissions!You need a Personal Access Token (PAT) with Copilot access.
🚀 Quick Setup: Create Copilot CLI Token (Pre-configured)
At minimum, you need:
Copilot Requests = Read-onlyTip
Save your token as a repository secret named
COPILOT_TOKENOrganization Repositories
Important
Fine-grained PAT Limitation: Organization-owned tokens cannot have the "Copilot Requests" permission — this is a GitHub platform limitation.
Workaround for Organization Repos:
copilot-tokenGITHUB_TOKENor an org token forrepo-token(for repository operations)This two-token pattern allows Copilot access while maintaining proper repository permissions.
Basic Setup
Add the following workflow to your
.github/workflowsfolder:Advanced Setup with MCP Servers
Configuration
Input Parameters
copilot-tokengithub.tokendoes NOT work — you must provide a PAT.promptrepo-tokencopilot-tokenif not set. Can use defaultGITHUB_TOKENhere.github.tokenmcp-configcopilot-configallow-all-toolstrueallowed-tools"shell(rm),shell(git push)")denied-tools"shell(rm),shell(git push)")copilot-version@github/copilotto install (e.g.,"latest","0.0.329")latestmodel"claude-sonnet-4.5","gpt-5")agentadditional-directories"/tmp,/var/log")disable-mcp-servers"github-mcp-server,custom-server")enable-all-github-mcp-toolsfalseresume-session"latest"for most recent)log-level"none","error","warning","info","debug","all","default"allupload-artifacttrueMCP Server Configuration
The action supports Model Context Protocol (MCP) servers for extending Copilot's capabilities. Configure MCP servers using JSON format with an
mcpServersobject where each key is the server name and the value contains its configuration.Important
See the official MCP server configuration docs for complete details.
Examples
📋 View All Example Workflows
/copilotand executes the requested taskTroubleshooting
Note
Most issues stem from token configuration.
Common Issues
"Copilot token required" / Permission Denied
GITHUB_TOKENdoes NOT have Copilot accessOrganization Repository Access Issues
copilot-tokenauthenticates with Copilot APIrepo-tokenhandles repository operations (commits, PRs, etc.)Copilot starts but permission denied
GITHUB_TOKEN.permissions: write-allto your workflow file.Tool Access Denied
allowed-toolsanddenied-toolsconfigurationallow-all-tools: false, you must explicitly allow needed toolsMCP Server Connection Issues
typeis set correctly (local,http, orsse)Session Resume Not Working
upload-artifact: trueresume-session: latestto continue the most recent sessionLarge Output Truncation
log-level: errororlog-level: warningto reduce verbosityRelated Resources