You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Burl%7D?q=fetch&page=16&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=fetch
Returns an array of strings in format "username" or "username/projectName"
Found 8139 results for "fetch"(420ms)
132console.log("🔍 Sending assignee request to:", url);
133134const response = await fetch(url, {
135method: "POST",
136headers: {
170171// Get detailed PR info including checks status
172console.log("🔍 Fetching detailed PR info...");
173try {
174const prDetails = await fetchPRDetails(repository.full_name, pull_request.number);
175console.log("🔍 PR details fetched successfully");
176console.log("🔍 PR mergeable status:", prDetails.mergeable);
177console.log("🔍 PR mergeable state:", prDetails.mergeable_state);
202return new Response("Notification sent to Slack", { status: 200 });
203} catch (prError) {
204console.error("❌ Error fetching PR details or sending notification:", prError);
205console.error("❌ Error stack:", prError.stack);
206return new Response(`Error: ${prError.message}\nStack: ${prError.stack}`, { status: 500 });
311}
312313// Fetch detailed PR information including checks status
314async function fetchPRDetails(repo: string, prNumber: number) {
315console.log(`🔍 Starting fetchPRDetails for PR #${prNumber} in ${repo}`);
316317const token = Deno.env.get("GITHUB_TOKEN");
324// Get PR details
325const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}`;
326console.log("🔍 Fetching from GitHub API URL:", url);
327328let response;
329try {
330response = await fetch(url, {
331headers: {
332"Authorization": `token ${token}`,
339console.log("🔍 Response status text:", response.statusText);
340console.log("🔍 Response headers:", JSON.stringify(Object.fromEntries([...response.headers])));
341} catch (fetchError) {
342console.error("❌ Network error fetching PR details:", fetchError);
343console.error("❌ Error stack:", fetchError.stack);
344throw new Error(`Network error fetching PR details: ${fetchError.message}`);
345}
346364}
365366throw new Error(`Failed to fetch PR details: ${response.status} ${response.statusText}`);
367}
368415console.log("🔍 Verifying PR is still mergeable before attempting merge");
416try {
417const prDetails = await fetchPRDetails(repo, prNumber);
418console.log("🔍 PR current mergeable status:", prDetails.mergeable);
419console.log("🔍 PR current mergeable state:", prDetails.mergeable_state);
458let response;
459try {
460response = await fetch(url, {
461method: "PUT",
462headers: {
472console.log("🔍 Response status text:", response.statusText);
473console.log("🔍 Response headers:", JSON.stringify(Object.fromEntries([...response.headers])));
474} catch (fetchError) {
475console.error("❌ Network error during merge request:", fetchError);
476console.error("❌ Error stack:", fetchError.stack);
477return {
478success: false,
479message: `Network error during merge: ${fetchError.message}`,
480};
481}
631let response;
632try {
633response = await fetch(slackWebhookUrl, {
634method: "POST",
635headers: {
642console.log("🔍 Response status text:", response.statusText);
643console.log("🔍 Response headers:", JSON.stringify(Object.fromEntries([...response.headers])));
644} catch (fetchError) {
645console.error("❌ Network error sending to Slack:", fetchError);
646console.error("❌ Error stack:", fetchError.stack);
647throw new Error(`Network error sending to Slack: ${fetchError.message}`);
648}
649