gh-auth-isolation

Detect and isolate active GitHub identities to prevent cross-account operations.

413|64|Updated Feb 7, 2023
One-click install
npx skills add https://github.com/christianhelle/refitter --skill gh-auth-isolation-christianhelle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-auth-isolation
Source: https://github.com/christianhelle/refitter/tree/main/.copilot/skills/gh-auth-isolation
Command: npx skills add https://github.com/christianhelle/refitter --skill gh-auth-isolation-christianhelle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing multiple GitHub identities in automated agent workflows can lead to accidental cross-account operations, failed pushes, and leaked credentials when EMU and personal accounts are mixed.

Core Features & Use Cases

  • Detect active identity before operations and verify which GitHub account is in use for a given shell or agent.
  • Provide isolation methods: configure separate gh config directories, use environment variables to scope tokens, and implement shell aliases to switch contexts.
  • Use case: an agent runs a workflow that must push to a personal repo while the default gh auth is EMU; switch context, perform the operation, then revert.

Quick Start

Enable identity isolation by configuring an isolated GitHub context for your agent workloads using gh config dir and environment variables.

Frequently Asked Questions about gh-auth-isolation

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

FAQPage Schema
How do I prevent accidental cross-account pushes when using multiple GitHub identities in automated workflows?

To prevent cross-account pushes, you must detect and isolate the active GitHub identity before executing operations. This involves scoping tokens via environment variables and using separate gh config directories to ensure agents operate within the correct account context.

What is the best way to manage mixed EMU and personal GitHub accounts in agent workflows?

Managing mixed EMU and personal accounts requires identity detection and context isolation. You can safely switch contexts using shell aliases to perform operations like pushes or clones, then revert to the default gh auth state to avoid credential leaks.

How does environment variable scoping work for GitHub token management in shell agents?

Environment variable scoping for GitHub token management works by binding specific tokens to isolated shell contexts. This ensures that automated agents only use the credentials mapped to the designated environment, preventing unauthorized cross-account access.

When do I need to configure separate gh config directories for GitHub identity isolation?

You need to configure separate gh config directories when an agent must perform operations across different GitHub accounts, such as pushing to a personal repo while defaulting to an EMU. This isolates the active identity and prevents cross-account token usage.

Can I use shell aliases to switch GitHub contexts for clones and pull requests?

Yes, you can use shell aliases to switch GitHub contexts for clones and pull requests. Aliases allow you to temporarily reassign the active identity, execute the required operation, and then revert the shell back to its default authentication state.