feat(github): add Vercel Connect support#650
Open
bensabic wants to merge 5 commits into
Open
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A new installationToken config option (string or resolver) supplies installation access tokens directly, skipping the GitHub App private-key JWT exchange, and an optional webhookVerifier verifies inbound webhooks (e.g. Connect trigger-forwarded requests via a Vercel OIDC token) in place of the GitHub webhook secret. Pair with connectGitHubAdapter() from @vercel/connect/chat. Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
Wire the GitHub adapter via connectGitHubAdapter() from @vercel/connect/chat (gated on GITHUB_CONNECTOR), replacing the stored GITHUB_TOKEN / GitHub App private key + webhook secret auth, and update the env docs accordingly. Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
In Connect mode the adapter only holds an installation token, so it can't auto-detect its bot user id via /user or /app (the latter needs the App's JWT) — leaving self-message detection off and causing the bot to reply to its own comments in a loop. Now botUserId also auto-detects from the GITHUB_BOT_USER_ID env var, the adapter learns its id from the first comment it posts, and detection skips the unusable /app fallback in Connect mode (removing a misleading 401 log). Set botUserId / GITHUB_BOT_USER_ID for reliable self-detection on serverless, where the in-memory learned id doesn't survive cold starts. Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
The GitHub adapter now auto-detects GITHUB_BOT_USER_ID, so the example no longer wires botUserId explicitly — set the env var to enable self-message detection and avoid reply loops. Document it in .env.example. Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
05e0cb3 to
84c09ee
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Excluding .git from the deployment broke the fumadocs lastModified() plugin, which shells out to `git log` and failed the docs build with exit status 128. .git isn't the upload-size problem (node_modules is), so keep it. Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
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.
Adds Vercel Connect support to the GitHub adapter:
installationTokenconfig option (string or resolver) supplies installation access tokens directly, skipping the GitHub App private-key JWT exchange.webhookVerifierverifies inbound webhooks (Connect trigger-forwarded requests via a Vercel OIDC token) in place of the GitHub webhook secret.Pair with
connectGitHubAdapter()from@vercel/connect/chat. Includes a changeset (@chat-adapter/githubminor).Stacked on #647 (base
vercel-connect/base).Companion
@vercel/connect/chatsubpath: vercel/vercel#16826.