gh-auth-isolation

Detect and switch GitHub identities using isolated gh config directories.

7|Updated Oct 24, 2020
One-click install
npx skills add https://github.com/snow-jallen/HomeSpeaker --skill gh-auth-isolation-snow-jallen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-auth-isolation
Source: https://github.com/snow-jallen/HomeSpeaker/tree/main/.copilot/skills/gh-auth-isolation
Command: npx skills add https://github.com/snow-jallen/HomeSpeaker --skill gh-auth-isolation-snow-jallen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing multiple GitHub identities (EMU and personal) within automated agent workflows can cause accidental cross-account actions, failed pushes, and insecure credential handling.

Core Features & Use Cases

  • Detects the currently active GitHub identity and surfaces its scope and token status to prevent misrouted operations.
  • Safely switch contexts by using per-account credentials and isolated gh config directories, avoiding credential leakage or mix-ups.
  • Use cases include pushing to personal forks from an EMU session, creating PRs from a personal clone, or performing actions that require separate authentication contexts.

Quick Start

Switch to the target GitHub identity for the next operation by configuring a dedicated gh config and authenticating.

Frequently Asked Questions about gh-auth-isolation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch GitHub identities in automated agent workflows without leaking credentials?

To switch GitHub identities safely, use per-account credentials and isolated gh config directories. This isolates authentication contexts, preventing credential leakage and accidental cross-account actions during automated agent workflows.

Why do my automated pushes fail when operating across enterprise EMU and personal GitHub accounts?

Pushes fail across enterprise EMU and personal GitHub accounts due to credential mix-ups and misrouted operations. Detecting the currently active identity and verifying its token status before switching contexts prevents these failed pushes.

Can I push to a personal fork from an EMU session using the gh CLI?

Yes, you can push to a personal fork from an EMU session by configuring a dedicated gh config directory and authenticating with the target GitHub identity. This isolates the enterprise and personal credentials for the operation.

What is the best way to manage multiple GitHub tokens in a single automated workflow?

The best way to manage multiple GitHub tokens in a single workflow is isolating credentials using per-account config directories. This enables safe context switching and prevents accidental cross-account actions like misrouted pushes.

How do I detect the current GitHub identity and its token status before creating a PR?

Detect the current GitHub identity and its token status by using gh authentication tooling to surface the active account scope. This verifies you are authenticated to the correct context before creating PRs from a personal clone.

When do I need isolated gh config directories for GitHub authentication?

You need isolated gh config directories when agents must operate across enterprise EMU and personal GitHub accounts. This isolation is required for safely switching contexts, preventing credential leakage, and avoiding cross-account mix-ups.