diff --git a/.github/workflows/genai-pr-review.yml b/.github/workflows/genai-pr-review.yml index 5a762eba38..a41a24160f 100644 --- a/.github/workflows/genai-pr-review.yml +++ b/.github/workflows/genai-pr-review.yml @@ -1,7 +1,6 @@ name: genai pull request review on: pull_request: - types: [ready_for_review] paths: - yarn.lock - ".github/workflows/ollama.yml" diff --git a/packages/core/src/github.ts b/packages/core/src/github.ts index cebbc23365..7a978c5971 100644 --- a/packages/core/src/github.ts +++ b/packages/core/src/github.ts @@ -68,6 +68,7 @@ export async function githubUpdatePullRequestDescription( commentTag: string ) { const { apiUrl, repository, issue } = info + assert(commentTag) if (!issue) return { updated: false, statusText: "missing issue number" } const token = await host.readSecret(GITHUB_TOKEN) @@ -89,15 +90,21 @@ export async function githubUpdatePullRequestDescription( const resGetJson = (await resGet.json()) as { body: string } let { body } = resGetJson if (!body) body = "" - const tag = `\n\n\n\n` - const endTag = `\n\n\n\n` + const tag = `` + const endTag = `` + const sep = "\n\n" const start = body.indexOf(tag) const end = body.indexOf(endTag) if (start > -1 && end > -1 && start < end) { - body = body.slice(0, start + tag.length) + text + body.slice(end) + body = + body.slice(0, start + tag.length) + + sep + + text + + sep + + body.slice(end) } else { - body = body + tag + text + endTag + body = body + sep + tag + sep + text + sep + endTag + sep } const res = await fetch(url, {