token-lifecycle-management

Automate GitHub Actions installation token refresh and caching across long-running jobs.

3|3|Updated Jan 4, 2026
One-click install
npx skills add https://github.com/adaptive-enforcement-lab/claude-skills --skill token-lifecycle-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-lifecycle-management
Source: https://github.com/adaptive-enforcement-lab/claude-skills/tree/main/plugins/patterns/skills/token-lifecycle-management
Command: npx skills add https://github.com/adaptive-enforcement-lab/claude-skills --skill token-lifecycle-management

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Long-running CI/CD workflows often encounter expired installation tokens, causing failures and manual rotation overhead. This Skill provides a structured approach to automate token expiration handling, refresh strategies, and caching to sustain operations.

Core Features & Use Cases

  • Automatic token refresh during long-running jobs using GitHub App tokens.
  • Manual, step-based, and matrix-based refresh patterns to fit workflow breaks and parallelism.
  • Token caching and sharing across matrix jobs to minimize authentication churn and reduce retries.
  • Error handling and recovery strategies for token expiry and API latency.

Quick Start

Start by generating a fresh installation token at the beginning of a long workflow and apply an automatic refresh strategy to keep the token valid throughout the run.

Frequently Asked Questions about token-lifecycle-management

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

FAQPage Schema
How do I prevent GitHub Actions tokens from expiring during long-running workflows?

To prevent GitHub Actions tokens from expiring during long-running workflows, apply automated token refresh strategies and caching to sustain operations. This approach uses actions/create-github-app-token@v2 to maintain uninterrupted CI/CD pipeline access.

What is the best way to handle token refresh in CI/CD pipelines that run for hours?

The best way to handle token refresh in multi-hour CI/CD pipelines is applying structured lifecycle management with manual, step-based, or matrix-based refresh patterns. This fits workflow breaks and parallelism while minimizing authentication churn and reducing retries.

How does token caching work across matrix jobs in GitHub Actions?

Token caching across matrix jobs in GitHub Actions works by sharing a single installation token across parallel executions to minimize authentication churn. This cross-job consistency approach reduces redundant token generation and API authentication retries during matrix workflows.

Can I use automatic token refresh with GitHub App tokens in my automation workflows?

Yes, you can use automatic token refresh with GitHub App tokens in automation workflows. The process applies actions/create-github-app-token@v2 to automatically generate fresh installation tokens and keep them valid throughout the entire run duration.

Why do my long-running automation workflows fail with expired installation tokens?

Long-running automation workflows fail with expired installation tokens because the credentials time out before the pipeline completes. Implementing time-based or step-based refresh strategies with secure error handling recovers from token expiry and API latency to maintain operations.

Do I need a specific token refresh strategy for parallel CI/CD jobs?

For parallel CI/CD jobs, you need a matrix-based token refresh strategy to fit workflow parallelism. This approach applies token caching and sharing across matrix jobs to minimize authentication churn and maintain cross-job consistency throughout the workflow.