-
Notifications
You must be signed in to change notification settings - Fork 50
Add GitHub App authentication support for Copilot, Claude, and Codex engines #12272
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
Changes from all commits
7043233
de8957e
808d7dc
bb64424
7659c0f
ed18acb
28954f2
570a7c5
2f8cd23
0542649
102dadc
e0063f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| --- | ||
| engine: | ||
| id: copilot | ||
| app: | ||
| app-id: ${{ vars.APP_ID }} | ||
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
| --- | ||
|
|
||
| <!-- | ||
|
|
||
| # GitHub Copilot with App Authentication | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The content of the body should be a xml comment @copilot
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 7659c0f - wrapped body content in XML comment following shared workflow pattern |
||
| This shared workflow configures the GitHub Copilot engine to use GitHub App authentication instead of personal access tokens. | ||
|
|
||
| ## Configuration | ||
|
|
||
| When imported, this provides: | ||
| - **GitHub App authentication** for Copilot CLI | ||
| - **Short-lived tokens** with `copilot-requests: read` permission | ||
| - **Automatic token invalidation** after workflow completion | ||
|
|
||
| ## Usage | ||
|
|
||
| Import this workflow to enable GitHub App authentication for Copilot: | ||
|
|
||
| ```yaml | ||
| --- | ||
| engine: copilot | ||
| imports: | ||
| - shared/copilot-app.md | ||
| --- | ||
| ``` | ||
|
|
||
| ## Requirements | ||
|
|
||
| Configure the following in your repository: | ||
| - **vars.APP_ID** - GitHub App ID | ||
| - **secrets.APP_PRIVATE_KEY** - GitHub App private key (PEM format) | ||
|
|
||
| ## Permissions | ||
|
|
||
| The generated token will have: | ||
| - `copilot-requests: read` - Required for GitHub Copilot CLI access | ||
|
|
||
| Additional permissions can be inherited from workflow-level `permissions:` configuration. | ||
|
|
||
| ## Benefits | ||
|
|
||
| - **Security**: Short-lived tokens (max 1 hour) instead of long-lived PATs | ||
| - **Audit**: App activity tracked separately in GitHub audit logs | ||
| - **Rotation**: No need to rotate tokens manually | ||
| - **Least privilege**: Minimal permissions for Copilot access | ||
|
|
||
| --> | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # validate_app_support_engine_field.sh - Validate GitHub App configuration for engine authentication | ||
| # | ||
| # Usage: validate_app_support_engine_field.sh ENGINE_NAME DOCS_URL | ||
| # | ||
| # Arguments: | ||
| # ENGINE_NAME : Name of the engine requiring GitHub App authentication (e.g., "GitHub Copilot CLI") | ||
| # DOCS_URL : Documentation URL for GitHub App configuration | ||
| # | ||
| # Environment variables (required): | ||
| # APP_ID : GitHub App ID (e.g., "${{ vars.APP_ID }}") | ||
| # APP_PRIVATE_KEY: GitHub App private key (e.g., "${{ secrets.APP_PRIVATE_KEY }}") | ||
| # | ||
| # Exit codes: | ||
| # 0 - GitHub App configuration is valid | ||
| # 1 - GitHub App configuration is invalid or missing | ||
|
|
||
| # Parse arguments | ||
| if [ "$#" -ne 2 ]; then | ||
| echo "Usage: $0 ENGINE_NAME DOCS_URL" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| ENGINE_NAME="$1" | ||
| DOCS_URL="$2" | ||
|
|
||
| echo "Validating GitHub App configuration for $ENGINE_NAME..." | ||
| echo "" | ||
|
|
||
| # Validate app-id variable | ||
| if [ -z "$APP_ID" ]; then | ||
| echo "❌ ERROR: GitHub App ID is not set" | ||
| echo "" | ||
| echo "To use GitHub App authentication with $ENGINE_NAME, you need to configure:" | ||
| echo " - vars.APP_ID (GitHub App ID)" | ||
| echo " - secrets.APP_PRIVATE_KEY (GitHub App private key)" | ||
| echo "" | ||
| echo "Documentation: $DOCS_URL" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Validate private-key secret | ||
| if [ -z "$APP_PRIVATE_KEY" ]; then | ||
| echo "❌ ERROR: GitHub App private key is not set" | ||
| echo "" | ||
| echo "To use GitHub App authentication with $ENGINE_NAME, you need to configure:" | ||
| echo " - vars.APP_ID (GitHub App ID)" | ||
| echo " - secrets.APP_PRIVATE_KEY (GitHub App private key)" | ||
| echo "" | ||
| echo "Documentation: $DOCS_URL" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "✅ GitHub App configuration validated successfully" | ||
|
|
||
| # Set step output to indicate verification succeeded | ||
| if [ -n "$GITHUB_OUTPUT" ]; then | ||
| echo "verification_result=success" >> "$GITHUB_OUTPUT" | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1464,4 +1464,3 @@ func TestFormatActionCacheKey(t *testing.T) { | |
| }) | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.