← ClaudeAtlas

accessing-github-reposlisted

GitHub repository access in containerized environments using REST API and credential detection. Use when git clone fails, or when accessing private repos/writing files via API.
oaustegard/claude-skills · ★ 124 · Code & Development · score 84
Install: claude install-skill oaustegard/claude-skills
# Accessing GitHub Repositories Git clone is blocked in containerized AI environments (egress proxy rejects CONNECT tunnel), but full repository access is available via GitHub REST API and raw file URLs. ## Quick Start ### Public Repos (no setup needed) ```bash # Individual file via raw URL curl -sL "https://raw.githubusercontent.com/OWNER/REPO/BRANCH/path/file" # Directory tree via API curl -sL "https://api.github.com/repos/OWNER/REPO/git/trees/BRANCH?recursive=1" ``` ### Private Repos or Write Access Requires GitHub Personal Access Token (PAT). See Setup section below. ## Setup ### Credential Configuration The skill automatically detects PATs from environment variables or project files: **Environment Variables** (checked in order): - `GITHUB_PAT` - `GH_PAT` - `GITHUB_TOKEN` - `GH_TOKEN` **Project Files** (Claude.ai): - `/mnt/project/.env` - `/mnt/project/github.env` Format: ```bash GITHUB_PAT=github_pat_11AAAAAA... ``` ### Creating a GitHub PAT 1. GitHub → Settings → Developer settings → Fine-grained tokens 2. Create token scoped to needed repositories 3. Set permissions: - **Contents: Read** - for private repo access - **Contents: Write** - for pushing files - **Issues: Write** - for issue management - **Pull requests: Write** - for creating PRs ### Network Access (Claude.ai Projects) Add to network allowlist: - `api.github.com` - `raw.githubusercontent.com` ## Capabilities by Auth Level | Capability | No PAT (public only) | PAT (read) | PAT (w