fix(webhooks): match scp-style repository URLs with any SSH user - #11122
Open
dannyqwertz wants to merge 1 commit into
Open
fix(webhooks): match scp-style repository URLs with any SSH user#11122dannyqwertz wants to merge 1 commit into
dannyqwertz wants to merge 1 commit into
Conversation
canonicalManualWebhookRepository() only recognised scp-style SSH URLs starting with the literal "git@". Gitea defaults to a "gitea@" SSH user, so "gitea@host:org/repo.git" fell through to the raw-path branch and never matched the payload's "org/repo", causing "Nothing to do". Manual deploys kept working because convertGitUrl() detects SSH URLs by shape rather than by a fixed user. Match on "<user>@host:path" instead.
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.
Changes
Fixes an issue where webhooks failed for Gitea (or other Git providers) when using non-standard SSH users (like gitea@domain.com instead of git@domain.com), resulting in the dreaded "Nothing to do" message.
What was happening?
(Note: I originally thought this was related to custom ports, ssh:// prefixes, or .git suffixes, but after debugging it boiled down to just the hardcoded SSH user prefix.)
What changed?
Issues
Category
AI Assistance
If AI was used:
Testing
Verified on a local instance with a real signed webhook: before the fix "Nothing to do...", after it the app is found and the deploy starts. A wrong repo or branch is still rejected.
Four tests added to WebhookHmacTest, including a negative one. All 33 pass.
Contributor Agreement
Important