Enumerate failing specs/E2E from CI artifacts; mute all github-actions comments
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgBEW6qAwgn2fcQbA2f4ZQ
This commit is contained in:
co-authored by
Claude Fable 5
parent
3b7850fe1a
commit
2015d20aa5
@@ -0,0 +1,29 @@
|
||||
import { getToken } from './token.js';
|
||||
import { GithubError } from './client.js';
|
||||
|
||||
const BASE = 'https://api.github.com';
|
||||
|
||||
export async function restJson<T>(path: string): Promise<T> {
|
||||
const res = await fetch(`${BASE}${path}`, {
|
||||
headers: {
|
||||
authorization: `bearer ${getToken()}`,
|
||||
accept: 'application/vnd.github+json',
|
||||
'user-agent': 'pr-monitor',
|
||||
},
|
||||
});
|
||||
if (!res.ok) {
|
||||
throw new GithubError(`GitHub REST ${path}: ${res.status}`);
|
||||
}
|
||||
return res.json() as Promise<T>;
|
||||
}
|
||||
|
||||
/** Download an artifact zip (follows the storage redirect). */
|
||||
export async function restZip(path: string, maxBytes: number): Promise<Uint8Array | null> {
|
||||
const res = await fetch(`${BASE}${path}`, {
|
||||
headers: { authorization: `bearer ${getToken()}`, 'user-agent': 'pr-monitor' },
|
||||
});
|
||||
if (!res.ok) throw new GithubError(`GitHub REST ${path}: ${res.status}`);
|
||||
const buf = new Uint8Array(await res.arrayBuffer());
|
||||
if (buf.byteLength > maxBytes) return null;
|
||||
return buf;
|
||||
}
|
||||
Reference in New Issue
Block a user