Skip to content

Commit 1e4c457

Browse files
committed
fix(ci): small fixups
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 98fd9d5 commit 1e4c457

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

.github/gallery-agent/helpers.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,22 +170,33 @@ func extractDescription(readme string) string {
170170
// Replace markdown links `[text](url)` with just `text`.
171171
s = regexp.MustCompile(`\[([^\]]+)\]\([^)]+\)`).ReplaceAllString(s, "$1")
172172

173-
// Drop table lines and horizontal rules.
173+
// Drop table lines and horizontal rules, and flatten all leading
174+
// whitespace: generateYAMLEntry embeds this under a `description: |`
175+
// literal block whose indentation is set by the first non-empty line.
176+
// If any line has extra leading whitespace (e.g. from an indented
177+
// `<p align="center">` block in the original README), YAML will pick
178+
// that up as the block's indent and every later line at a smaller
179+
// indent blows the block scalar. Stripping leading whitespace here
180+
// guarantees uniform 4-space indentation after formatTextContent runs.
174181
var kept []string
175182
for _, line := range strings.Split(s, "\n") {
176-
t := strings.TrimSpace(line)
177-
if strings.HasPrefix(t, "|") {
183+
t := strings.TrimLeft(line, " \t")
184+
ts := strings.TrimSpace(t)
185+
if strings.HasPrefix(ts, "|") {
178186
continue
179187
}
180-
if strings.HasPrefix(t, ":--") || strings.HasPrefix(t, "---") || strings.HasPrefix(t, "===") {
188+
if strings.HasPrefix(ts, ":--") || strings.HasPrefix(ts, "---") || strings.HasPrefix(ts, "===") {
181189
continue
182190
}
183-
kept = append(kept, line)
191+
kept = append(kept, t)
184192
}
185193
s = strings.Join(kept, "\n")
186194

187-
// Normalise whitespace.
195+
// Normalise whitespace and drop any leading blank lines so the literal
196+
// block in YAML doesn't start with a blank first line (which would
197+
// break the indentation detector the same way).
188198
s = cleanTextContent(s)
199+
s = strings.TrimLeft(s, " \t\n")
189200

190201
// Truncate at a paragraph boundary around maxLen chars.
191202
const maxLen = 1200

.github/workflows/gallery-agent.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
env:
5353
GH_TOKEN: ${{ secrets.UPDATE_BOT_TOKEN }}
5454
REPO: ${{ github.repository }}
55-
SEARCH: 'chore(model gallery) in:title :robot:'
55+
SEARCH: 'gallery agent in:title'
5656
run: |
5757
# Walk open gallery-agent PRs and act on maintainer comments:
5858
# /gallery-agent blacklist → label `gallery-agent/blacklisted` + close (never repropose)
@@ -82,7 +82,7 @@ jobs:
8282
env:
8383
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8484
REPO: ${{ github.repository }}
85-
SEARCH: 'chore(model gallery) in:title :robot:'
85+
SEARCH: 'gallery agent in:title'
8686
run: |
8787
# Skip set =
8888
# URLs from any open gallery-agent PR (avoid duplicate PRs for the same model while one is pending)

0 commit comments

Comments
 (0)