Skip to content

feat(actions): add GitHub App authentication support for review actions #7228

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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

bdougie
Copy link
Collaborator

@bdougie bdougie commented Aug 18, 2025

Description

This PR enhances the Continue review actions to support GitHub App authentication, enabling reviews to be posted as the Continue Agent bot instead of the github-actions bot. This provides a better user experience with proper bot identity and improved rate limits.

Key Changes:

  1. Standardized GitHub App Authentication: All three review actions (base-review, general-review, detailed-review) now support GitHub App authentication by default with use_github_app: true.

  2. Flexible Token System: Introduced a github-token input parameter that allows external workflows to pass their own GitHub App tokens, enabling full control over authentication. This was only because I could not test it locally without it being installed. I installed it on my bdougie/contributor.info#459 repo to test. cc @sestinj for installing https://github.com/apps/continue-agent

  3. Smart Fallback Chain:

    • Priority: Explicitly provided token → Generated app token → Default GitHub Actions token - This keeps the existing working
    • Automatically falls back if app credentials are missing or app isn't installed
  4. Simplified Base Action: The base-review action now delegates to detailed-review, eliminating duplicate code and ensuring consistent behavior. IMO - detailed review has all the value.

  5. Zero-Config for External Users: External repositories can use the action with just CONTINUE_API_KEY.

  6. Enhanced Security Features: - _Suggest in the review because I ran prettier on the existing code. @tomasz-stefaniak _

    • Workflow-level filtering: Only runs on PRs or when @continue-agent is mentioned
    • Authorization checks: Validates user permissions (OWNER/MEMBER/COLLABORATOR)
    • Input sanitization: Secure handling of custom prompts to prevent code injection
    • Multi-layer security: Defense in depth approach
  7. Custom Review Prompts: Users can now provide specific instructions:

    • @continue-agent - Standard review
    • @continue-agent detailed - Detailed review
    • @continue-agent focus on security - Custom focus area
    • Prompts are sanitized and handled securely

Authentication Flow:

# Simplest usage - uses default GitHub Actions token
- uses: continuedev/continue/actions/base-review@main
  with:
    continue-api-key: ${{ secrets.CONTINUE_API_KEY }}

# With GitHub App (auto-generates token internally)
- uses: continuedev/continue/actions/base-review@main
  with:
    continue-api-key: ${{ secrets.CONTINUE_API_KEY }}
    app-id: ${{ secrets.CONTINUE_APP_ID }}
    app-private-key: ${{ secrets.CONTINUE_APP_PRIVATE_KEY }}

# External token (for users who generate their own)
- uses: continuedev/continue/actions/base-review@main
  with:
    continue-api-key: ${{ secrets.CONTINUE_API_KEY }}
    github-token: ${{ steps.generate-token.outputs.token }}

Security Improvements:

  • Workflow filtering: Prevents unnecessary runs and secret exposure
  • Comment sanitization: Treats user input as data, never as executable code
  • Temp file usage: Avoids shell injection vulnerabilities
  • Permission validation: Only authorized users can trigger reviews
  • Resource protection: Reduces unnecessary workflow runs

Benefits:

  • Branded Bot Identity: Reviews appear from continue-agent[bot] instead of github-actions[bot]
  • Better Rate Limits: GitHub Apps have higher API rate limits
  • Enhanced Security: Uses short-lived tokens instead of long-lived PATs
  • Graceful Degradation: Works without app installation, just with reduced features
  • User-Friendly Setup: Helpful error messages guide users through app installation if needed
  • Flexible Reviews: Support for custom review instructions via comments

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can still trigger a review by commenting @continue-general-review or @continue-detailed-review, however this would be cleaner as a webhook in the future.

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Screenshot 2025-08-20 at 3 18 06 PM

The main goal was allowing the app to comment instead of GitHub. The other changes were clean from the reviews.

Now use the GitHub App logo to comment.

Tests

[ What tests were added or updated to ensure the changes work as expected? ]

.github/workflows/test-continue-agent.yml is the test and will be deleted once confirmed working. We first need to add the CONTINUE_APP_PRIVATE_KEY & CONTINUE_APP_ID


Summary by cubic

Adds GitHub App authentication to the review actions so reviews post as continue-agent[bot] with better rate limits and short‑lived tokens. Defaults to the app and falls back to the standard Actions token if not configured.

  • New Features

    • Support GitHub App auth in general-review and detailed-review via use_github_app (default true) with fallback to GITHUB_TOKEN.
    • Generate app tokens using actions/create-github-app-token with CONTINUE_APP_ID (variable) and CONTINUE_APP_PRIVATE_KEY (secret); pass GH_TOKEN to checkout and github-script.
    • Update docs with setup, benefits, and troubleshooting; add a test workflow to exercise both app and non‑app modes.
  • Migration

    • Install the Continue Agent app and grant repo access; add CONTINUE_APP_PRIVATE_KEY (secret) and CONTINUE_APP_ID (variable).
    • Or set use_github_app: false to keep using github-actions[bot].
    • Ensure workflow permissions: contents read; pull-requests and issues write.

- Add optional GitHub App integration for bot identity
- Add `use_github_app` input parameter (defaults to true)
- Generate app tokens when configured for branded bot identity
- Provide fallback to standard GitHub Actions token
- Update documentation with setup instructions and benefits
- Add troubleshooting guide for app configuration issues
@bdougie bdougie force-pushed the bdougie/continue-agent branch from 6f973aa to 4e5e4fe Compare August 20, 2025 12:50
bdougie added a commit to bdougie/contributor.info that referenced this pull request Aug 20, 2025
- Add issues: write permission for comment handling
- Add actions: read for workflow access
- Add checks: write for status updates
- Revert to bdougie/continue-agent branch for active development

Related to continuedev/continue#7228
bdougie added a commit to bdougie/contributor.info that referenced this pull request Aug 20, 2025
…issue

The bdougie/continue-agent branch has an issue where it tries to access
secrets directly in action.yml which isn't allowed. Switching to main
branch until continuedev/continue#7228 is merged.
bdougie added a commit to bdougie/contributor.info that referenced this pull request Aug 20, 2025
Maintaining reference to development branch where the Continue action
is being actively developed. The secrets access issue will be fixed
in continuedev/continue#7228
bdougie and others added 8 commits August 20, 2025 06:01
- Remove use_github_app complexity from general-review action
- Add github-token as optional input to both actions
- Allow token generation to be handled by workflow instead of action
- Simplify token logic to use provided token or default to github.token

This allows users to generate GitHub App tokens in their workflows
and pass them to the actions, providing more flexibility.
- Base action now generates GitHub App token internally
- Uses Continue's app credentials (vars.CONTINUE_APP_ID and secrets.CONTINUE_APP_PRIVATE_KEY)
- Users only need to provide CONTINUE_API_KEY
- Simplifies setup - no GitHub App configuration needed by users
- Simplified workflow to match what external users would use
- Shows minimal setup with just CONTINUE_API_KEY
- Includes proper permissions for GitHub App operations
- Demonstrates the zero-config approach for AI code reviews
- Composite actions cannot access repository vars/secrets directly
- Changed to accept app-id and app-private-key as inputs
- Defaults app-id to Continue Agent App ID (1090372)
- Falls back to github.token if no app credentials provided
- Added examples showing both basic and GitHub App usage
- Both app-id and app-private-key are now passed as secrets
- Removed default app-id value
- Updated test workflow to use proper secret names
- Users need to set CONTINUE_APP_ID and CONTINUE_APP_PRIVATE_KEY in their repo secrets
@bdougie bdougie marked this pull request as ready for review August 20, 2025 13:47
@bdougie bdougie requested a review from a team as a code owner August 20, 2025 13:47
@bdougie bdougie requested review from tomasz-stefaniak and removed request for a team August 20, 2025 13:47
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 20, 2025
Copy link

dosubot bot commented Aug 20, 2025

Related Documentation

No published documentation to review for changes on this repository.
Write your first living document

How did I do? Any feedback?  Join Discord

- Added continue-on-error to GitHub App token generation
- Made app-id and app-private-key truly optional in workflow
- Action will use GitHub App token if available, otherwise falls back to github.token
- Prevents 'Not Found' error when app is not installed on repository
- Simplifies setup for users who don't have the GitHub App installed
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces GitHub App authentication support for Continue's code review actions and adds a new base-review action for zero-config setup. The implementation is solid but has several areas that need attention, particularly around error handling, security practices, and script robustness.


💡 To request a new detailed review, comment @continue-detailed-review

Copy link

⚠️ AI review completed but no review output was generated. Check the action logs for details.


💡 To request a new review, comment @continue-general-review

- Automatically posts a comment if GitHub App token generation fails
- Provides clear instructions on how to install the Continue Agent app
- Explains benefits of using the app vs default token
- Helps users understand the setup process
- Still allows reviews to work without the app
Copy link

⚠️ AI review completed but no review output was generated. Check the action logs for details.


💡 To request a new review, comment @continue-general-review

- Changed org from 'continue' to 'continuedev'
- Changed config from 'continue/default' to 'continuedev/clean-code'
- Uses the clean code review configuration for better code analysis
- Changed config from 'continuedev/clean-code' to 'continuedev/review-bot'
- Uses the dedicated review bot configuration
@bdougie bdougie marked this pull request as draft August 20, 2025 21:49
@bdougie bdougie marked this pull request as ready for review August 20, 2025 21:49
@continuedev continuedev deleted a comment from github-actions bot Aug 20, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces a GitHub App integration for Continue Agent reviews and adds a new base-review action for zero-config setup. While the implementation is generally good, there are several areas that need attention: security improvements for error handling, consistency in naming conventions, better user guidance, and some potential edge cases in the review logic.


💡 To request a new detailed review, comment @continue-detailed-review

- Added github-token as optional input parameter
- Prioritizes passed github-token over generated app token
- Allows users to provide their own GitHub App token from workflow
- Maintains backward compatibility with existing workflows

This enables workflows to generate GitHub App tokens externally and pass them to the action, allowing comments to appear from the GitHub App bot even when the action doesn't have direct access to app credentials.
- Removed use_github_app flag and app credential inputs from all actions
- All actions now accept optional github-token parameter
- Simplified detailed-review action to match general-review pattern
- Base-review action now follows same token priority: passed token > app token > default
- Consistent authentication approach across all review actions

This allows users to:
1. Use default github.token (comments as github-actions bot)
2. Pass their own GitHub App token (comments as app bot)
3. Let base-review generate app token if credentials provided
Copy link

Code Review Summary

✅ Strengths

  • GitHub App Integration: Excellent implementation of GitHub App support for better bot identity and enhanced rate limits
  • Zero-Config Option: New base-review action provides a simplified setup experience with sensible defaults
  • Improved Token Management: Proper handling of token precedence (app token > provided token > default token)
  • User Experience: Helpful bot messages when GitHub App is not installed, guiding users through setup
  • Documentation: Comprehensive README updates with clear setup instructions and troubleshooting guide
  • Flexibility: Actions support both with and without GitHub App, giving users choice

⚠️ Issues Found

High

  • Branch Reference Issue: The base-review action references @bdougie/continue-agent branch instead of a stable reference. This could break when the branch is deleted or renamed.

Medium

  • Missing Input Validation: The new use_github_app input is documented in README but not implemented in the actual action files
  • Inconsistent Token Handling: The base-review action doesn't use the token management pattern from general/detailed review actions
  • Security Consideration: Storing app ID as a variable instead of a secret may expose it unnecessarily (though not critical)

Low

  • TODO Comments: Both general and detailed review actions contain TODO comments about consolidating into a single action - these should be tracked as issues
  • Hardcoded Values: Base-review action hardcodes continue-org: "continuedev" and continue-config: "continuedev/review-bot" which limits flexibility

💡 Suggestions

  • Single Entry Point: Consider implementing the TODO suggestion to create a unified @continue-agent mention handler that intelligently routes to general or detailed review
  • Configuration Inheritance: Allow base-review to accept optional org/config inputs while maintaining zero-config defaults
  • Error Handling: Add validation for GitHub App credentials format before attempting to generate token
  • Testing: Add workflow tests to verify both GitHub App and non-App paths work correctly
  • Migration Guide: Consider adding a migration section for users moving from existing review actions to the new base-review

🚀 Overall Assessment

COMMENT

This PR successfully implements GitHub App integration for Continue's code review actions, providing a better user experience with branded bot identity and improved rate limits. The zero-config base-review action is a great addition for quick setup. However, the branch reference issue should be fixed before merging, and the missing use_github_app input implementation needs to be addressed. The overall architecture is sound and the documentation is thorough.


💡 To request a new review, comment @continue-general-review

- All actions now have use_github_app flag (defaults to true)
- All actions can fallback to CONTINUE_APP_ID and CONTINUE_APP_PRIVATE_KEY secrets
- Default app-id is 1090372 (Continue Agent App ID)
- Base-review now uses detailed-review action for all reviews
- Token priority: provided token > app token > default token

This enables GitHub App authentication by default while allowing fallback to:
1. Repository secrets (CONTINUE_APP_ID, CONTINUE_APP_PRIVATE_KEY)
2. Default GitHub Actions token if app auth fails
- Removed trailing spaces
- Standardized comment formatting
- Consistent indentation and spacing
- Add continue-org and continue-config as configurable inputs to base-review (defaults maintained)
- Add authorization checks to base-review action for security
- Add validation for GitHub App credentials (warn if only one provided)
- Remove TODO comments from production code
- Keep action reference as @main until PR is merged
- Improve user permissions validation for both PR and comment events

This addresses the main review concerns:
- Security: Added permission checks for OWNER/MEMBER/COLLABORATOR
- Flexibility: Made base-review configurable while keeping zero-config defaults
- Consistency: Better validation and error messages
- Code quality: Removed TODO comments
- Re-added TODO comments for action consolidation feature
- These represent valid future improvements to track
- Will be addressed in a follow-up PR to consolidate actions
@bdougie
Copy link
Collaborator Author

bdougie commented Aug 20, 2025

✅ Review Comments Addressed

Thank you for the thorough reviews! I've addressed all the major concerns raised:

🔧 Changes Made:

  1. Fixed Configuration Flexibility (High Priority)

    • Added continue-org and continue-config as configurable inputs to base-review action
    • Maintained zero-config defaults (continuedev and continuedev/review-bot)
    • Users can now customize their review configuration while keeping the simple setup option
  2. Added Security/Authorization Checks (High Priority)

    • Added permission validation for PR authors and commenters
    • Only OWNER, MEMBER, or COLLABORATOR can trigger reviews
    • Prevents unauthorized users from triggering reviews
  3. Fixed Branch Reference (High Priority)

    • Changed action reference to @main instead of @bdougie/continue-agent
    • This prevents breakage when the feature branch is deleted after merge
  4. Added GitHub App Credential Validation (Medium Priority)

    • Validates that both app-id and app-private-key are provided together
    • Shows warning if only one is provided
    • Helps users understand configuration requirements
  5. Improved Token Management (Medium Priority)

    • Standardized token handling across all actions
    • Consistent fallback chain: provided token → app token → default token
    • All actions now support the same authentication patterns
  6. TODO Comments (Low Priority)

    • Kept TODO comments as they represent valid future improvements
    • Will be addressed in a follow-up PR to consolidate actions into a single intelligent handler

📊 Summary:

The base-review action now provides the best of both worlds:

  • Zero-config by default (just needs CONTINUE_API_KEY)
  • Fully configurable for advanced users who need custom settings
  • Secure with proper authorization checks
  • User-friendly with helpful error messages and setup guidance

All three actions (base-review, general-review, detailed-review) now follow consistent patterns for authentication and configuration, making the codebase more maintainable.

Ready for final review! 🚀

- Add if condition to workflow to only run on PRs or @continue-agent mentions
- Prevent workflow from running on every issue comment (security fix)
- Implement secure handling of custom prompts after @continue-agent
- Sanitize input by using temp files and treating as data, not code
- Support custom review instructions: '@continue-agent focus on security'
- Add example usage documentation

This addresses the security concern about exposing secrets on every comment
while adding support for custom review prompts in a secure way.
@continuedev continuedev deleted a comment from github-actions bot Aug 20, 2025
@continuedev continuedev deleted a comment from github-actions bot Aug 20, 2025
@continuedev continuedev deleted a comment from github-actions bot Aug 20, 2025
@continuedev continuedev deleted a comment from github-actions bot Aug 20, 2025
@continuedev continuedev deleted a comment from github-actions bot Aug 20, 2025
- Quote all GITHUB_OUTPUT and GITHUB_ENV variables
- Prevents potential word splitting issues in shell scripts
- Follows shell scripting best practices for variable quoting
- Improves script robustness and security
- Add comprehensive documentation for base-review action
- Include zero-config setup examples
- Add custom review prompt examples with @continue-agent
- Document security features and multi-layer protection
- Remove test workflow and standalone example file
- Consolidate all documentation in actions/README.md
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 20, 2025
- Format YAML and Markdown files with prettier
- Fix trailing spaces and consistent formatting
- Align table columns in README
- Ensure consistent line breaks and spacing
bdougie added a commit to bdougie/contributor.info that referenced this pull request Aug 20, 2025
* feat: Add Continue Agent for AI-powered code reviews (#458)

- Adds GitHub Actions workflow for automated AI code reviews
- Triggers on PR open, sync, and ready_for_review events
- Supports manual trigger via issue comments (@continue-agent review)
- Uses Continue's base-review action for streamlined setup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

* fix: Update Continue Agent action to use bdougie/continue-agent branch and GitHub App auth

* fix: Update permissions and revert to bdougie/continue-agent branch

- Add issues: write permission for comment handling
- Add actions: read for workflow access
- Add checks: write for status updates
- Revert to bdougie/continue-agent branch for active development

Related to continuedev/continue#7228

* fix: Temporarily use main branch until PR #7228 fixes secrets access issue

The bdougie/continue-agent branch has an issue where it tries to access
secrets directly in action.yml which isn't allowed. Switching to main
branch until continuedev/continue#7228 is merged.

* fix: Keep bdougie/continue-agent branch reference

Maintaining reference to development branch where the Continue action
is being actively developed. The secrets access issue will be fixed
in continuedev/continue#7228

* fix: Remove use_github_app flag from Continue action config

* feat: Add GitHub App token generation for authenticated comments

- Generate GitHub App token before running Continue action
- Pass token to Continue action for authenticated API calls
- Comments will now appear from the GitHub App instead of Actions bot

* fix: Remove github-token parameter that's not accepted by Continue action

The Continue base-review action doesn't have a github-token input defined,
so passing it was causing the workflow to fail. Removed the GitHub App
token generation step and the github-token parameter.

* fix: Simplify Continue workflow - action handles GitHub App internally

The Continue base-review action now handles GitHub App token generation
internally using Continue's centralized app credentials. Users only need
to provide CONTINUE_API_KEY, making the setup much simpler.

Removed:
- Manual GitHub App token generation step
- APP_ID and APP_PRIVATE_KEY secrets requirement
- github-token parameter passing
- Unnecessary permissions block

The action will automatically post reviews as the Continue Agent bot.

* feat: Add workflow_dispatch and update triggers/permissions

- Removed 'synchronize' trigger to reduce unnecessary runs
- Added workflow_dispatch for manual testing
- Added explicit permissions for security best practices

* feat: Use Continue App credentials for GitHub App authentication

Now using CONTINUE_APP_ID and CONTINUE_APP_PRIVATE_KEY to generate
a GitHub App token that's passed to the Continue action. This enables
comments to be posted as the Continue Agent app instead of github-actions[bot].

Required secrets:
- CONTINUE_API_KEY: Continue service API key
- CONTINUE_APP_ID: Continue's GitHub App ID
- CONTINUE_APP_PRIVATE_KEY: Continue's GitHub App private key

* feat: Add synchronize trigger to Continue workflow

Workflow now runs on:
- opened: when PR is created
- synchronize: when new commits are pushed to PR
- ready_for_review: when draft PR is marked ready

* chore: Pin Continue action to main branch

Changed from bdougie/continue-agent to main branch.
Added TODO to pin to specific SHA after Continue merges
GitHub App token support.

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant