Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions script/beta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ function lines(prs: PR[]) {
return prs.map((x) => `- #${x.number}: ${x.title}`).join("\n") || "(none)"
}

function group(title: string) {
if (process.env.GITHUB_ACTIONS !== "true") {
console.log(title)
return { [Symbol.dispose]() {} }
}
console.log(`::group::${title}`)
Comment on lines +60 to +65
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

::group:: workflow commands require escaping data (%, \r, \n) per GitHub Actions docs. Since title includes PR titles (untrusted input), a title containing newlines or %0A-style sequences could inject additional workflow commands and/or break log grouping. Consider sanitizing title before printing (e.g., replace %%25, \r%0D, \n%0A).

Suggested change
function group(title: string) {
if (process.env.GITHUB_ACTIONS !== "true") {
console.log(title)
return { [Symbol.dispose]() {} }
}
console.log(`::group::${title}`)
function escapeGitHubActionsCommandValue(value: string) {
return value.replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A")
}
function group(title: string) {
if (process.env.GITHUB_ACTIONS !== "true") {
console.log(title)
return { [Symbol.dispose]() {} }
}
console.log(`::group::${escapeGitHubActionsCommandValue(title)}`)

Copilot uses AI. Check for mistakes.
return {
[Symbol.dispose]() {
console.log("::endgroup::")
},
}
}

async function typecheck() {
console.log(" Running typecheck...")

Expand Down Expand Up @@ -227,8 +240,8 @@ async function main() {
const failed: FailedPR[] = []

for (const [idx, pr] of prs.entries()) {
console.log(`\nProcessing PR ${idx + 1}/${prs.length} #${pr.number}: ${pr.title}`)

console.log()
using _ = group(`Processing PR ${idx + 1}/${prs.length} #${pr.number}: ${pr.title}`)
console.log(" Fetching PR head...")
try {
await $`git fetch origin pull/${pr.number}/head:pr/${pr.number}`
Expand Down
Loading