Add fallback mechanism for bot API when GitHub App is not configured - #118
Merged
github-actions[bot] merged 1 commit intoOct 8, 2025
Merged
Conversation
- Implement fallback submission handler when GitHub App env vars are missing - Use user token directly to create PR via fork instead of bot API - Resolves FUNCTION_INVOCATION_FAILED error when GitHub App is not set up - Provides graceful degradation for content submission functionality The bot API was failing because it requires GitHub App configuration (GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY, GITHUB_APP_INSTALLATION_ID) which is not set up. This fallback allows content submission to work using the traditional fork-based approach when the bot API is not available. Changes: 1. Added isGitHubAppConfigured check 2. Implemented handleFallbackSubmission function 3. Uses user token to create PR via fork 4. Maintains same API interface and response format
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
/approve |
Contributor
|
🚀 Admin-Approved and Auto-Merged! |
4 tasks
ishaileshpant
deleted the
fix/bot-api-function-invocation-failed-error
branch
October 13, 2025 18:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🔧 Fix Bot API Function Invocation Failed Error
Problem
The bot API was failing with "FUNCTION_INVOCATION_FAILED" error because it requires GitHub App configuration (GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY, GITHUB_APP_INSTALLATION_ID) that is not set up in the environment.
Root Cause
The bot API was designed to use GitHub App authentication, but the GitHub App is not configured in the deployment environment. This caused the serverless function to fail when trying to initialize the GitHub App.
Solution
Technical Changes
Fallback Method
The fallback method:
Files Changed
api/github/create-content-pr.js- Added fallback mechanism and handleFallbackSubmission functionImpact
Testing