bug: patterns-files="." causes 500 error from Gitea API #70

Closed
opened 2026-05-11 13:15:24 +00:00 by rodin · 0 comments
Owner

Problem

When patterns-files is set to ., the client passes it directly to the Gitea contents API:

GET /api/v1/repos/owner/repo/contents/.

Gitea rejects this with HTTP 500:

routers/api/v1/repo/file.go:835:getRepoContents() [E] InternalServerError: path contains a malformed path component [path: .]

Root Cause

ListContents() only handles empty string specially. When path is ., it appends it to the URL.

Fix

Normalize . to "" before calling the API. In ListContents() or in fetchPatterns() before the call:

if path == "." {
    path = ""
}

Workaround

Use patterns-files: "" instead of patterns-files: "." in workflow configs.

## Problem When `patterns-files` is set to `.`, the client passes it directly to the Gitea contents API: ``` GET /api/v1/repos/owner/repo/contents/. ``` Gitea rejects this with HTTP 500: ``` routers/api/v1/repo/file.go:835:getRepoContents() [E] InternalServerError: path contains a malformed path component [path: .] ``` ## Root Cause `ListContents()` only handles empty string specially. When path is `.`, it appends it to the URL. ## Fix Normalize `.` to `""` before calling the API. In `ListContents()` or in `fetchPatterns()` before the call: ```go if path == "." { path = "" } ``` ## Workaround Use `patterns-files: ""` instead of `patterns-files: "."` in workflow configs.
rodin added the wip label 2026-05-11 13:21:41 +00:00
rodin removed the wip label 2026-05-11 13:25:30 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rodin/review-bot#70