Search

252 results found for api.github.com (1110ms)

Code
212

try {
// GitHub API URL for repo contents
const apiUrl = `https://api.github.com/repos/${owner}/${repo}/contents/${path}`;
console.log(`Fetching from: ${apiUrl}`);
try {
// GitHub API URL for repo contents
const apiUrl = `https://api.github.com/repos/${owner}/${repo}/contents/${path}`;
console.log(`Fetching from: ${apiUrl}`);
if (url.pathname === "/contributions") {
const username = url.searchParams.get("username") || "Joshuakibwage";
const GITHUB_API_URL = `https://api.github.com/users/${username}/events`;
try {
const { access_token } = await tokenResponse.json();
const userResponse = await fetch("https://api.github.com/user", {
headers: {
"Authorization": `token ${access_token}`,
async function fetchRepositoryContent(owner, repo, specifiedBranch = null, ignoredPatterns, sele
// First, try to get the default branch or use the specified branch
const repoInfoUrl = `https://api.github.com/repos/${owner}/${repo}`;
const repoInfoResponse = await fetch(repoInfoUrl, {
headers: {
const defaultBranch = specifiedBranch || repoInfo.default_branch;
const apiUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${defaultBranch}?recur
const response = await fetch(apiUrl, {
headers: {
async function fetchFileContent(owner, repo, path, branch) {
const apiUrl = `https://api.github.com/repos/${owner}/${repo}/contents/${path}`;
const response = await fetch(apiUrl, {
headers: {
// Add new function to get repository file types
async function getRepositoryFileTypes(owner, repo, specifiedBranch = null) {
const repoInfoUrl = `https://api.github.com/repos/${owner}/${repo}`;
const repoInfoResponse = await fetch(repoInfoUrl, {
headers: {
const defaultBranch = specifiedBranch || repoInfo.default_branch;
const apiUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${defaultBranch}?recur
const response = await fetch(apiUrl, {
headers: {
const { access_token } = await tokenResponse.json();
const userResponse = await fetch("https://api.github.com/user", {
headers: {
"Authorization": `token ${access_token}`,
);
const fetcher = () => {
const gistUrl = "https://api.github.com/gists/979a41207cb789364e2c78181bafc331";
return fetch(gistUrl)
// Note: This is a mock implementation as actual GitHub API requires authentication
// In a real-world scenario, you'd need a GitHub Personal Access Token
const response = await fetch('https://api.github.com/repos/USERNAME/REPO/contents/content.tx
method: 'PUT',
headers: {
const workflow = url.searchParams.get("workflow");
let github_api_url = `https://api.github.com/repos/${user}/${repository}/actions/runs?branch
// Reduce data
if (!workflow) github_api_url += "&per_page=1";
const { access_token } = await tokenResponse.json();
const userResponse = await fetch("https://api.github.com/user", {
headers: {
"Authorization": `token ${access_token}`,

Vals

No vals found

Users

No users found

Docs

40
View more
No docs found