Celebrate onboarding and agent wins with GitHub star prompts (#5642)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -236,8 +236,16 @@ function isNoPullRequestError(err: unknown): boolean {
|
||||
export async function checkOrcaStarred(): Promise<boolean | null> {
|
||||
await acquire()
|
||||
try {
|
||||
await execFileAsync('gh', ['api', `user/starred/${ORCA_REPO}`], { encoding: 'utf-8' })
|
||||
return true
|
||||
const { stdout, stderr } = await execFileAsync(
|
||||
'gh',
|
||||
['api', '--include', `user/starred/${ORCA_REPO}`],
|
||||
{ encoding: 'utf-8' }
|
||||
)
|
||||
const response = `${stdout ?? ''}\n${stderr ?? ''}`
|
||||
if (/HTTP\/\S+\s+(?:200|204)\b/.test(response)) {
|
||||
return true
|
||||
}
|
||||
return null
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err)
|
||||
// 404 means the user hasn't starred — the only expected "no" answer
|
||||
|
||||
Reference in New Issue
Block a user