preventing-github-actions-loops

Detect cyclic trigger paths in GitHub Actions workflow files.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/hicucu/forge --skill preventing-github-actions-loops
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: preventing-github-actions-loops
Source: https://github.com/hicucu/forge/tree/main/skills/preventing-github-actions-loops
Command: npx skills add https://github.com/hicucu/forge --skill preventing-github-actions-loops

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GitHub Actions workflows can accidentally trigger each other in infinite recursive loops when workflow outputs like pushes, pull requests, comments, or tags re-activate other workflows in the same repository. These loops waste CI/CD resources, generate failed runs, and clutter repository activity logs, making it hard to track legitimate pipeline executions.

Core Features & Use Cases

  • Pre-write guardrails: Provides a checklist and recommended guard patterns to insert when authoring new workflows to avoid loop-prone trigger configurations.
  • Runtime audit workflow: Offers a step-by-step process to scan existing .github/workflows/*.yml files for cyclic trigger paths, including hard-to-detect mutual A→B→A loops.
  • Use case: If you maintain a repository with an auto-commit workflow that pushes documentation changes, use this skill to verify the push event won't re-trigger the same workflow and add a [skip ci] guard to eliminate the loop risk.

Quick Start

Use the preventing-github-actions-loops skill to audit all workflows in your repository's .github/workflows directory for potential infinite trigger loops and get prioritized fix recommendations for any high-risk candidates found.

Frequently Asked Questions about preventing-github-actions-loops

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

FAQPage Schema
How do I prevent GitHub Actions workflows from triggering each other in an infinite loop?▼

To prevent GitHub Actions infinite trigger loops, you must audit interconnected workflows for cyclic trigger paths and implement pre-write guardrails like [skip ci] tags. This process scans .github/workflows/*.yml files to detect and eliminate mutual A→B→A loop paths.

Why do my GitHub Actions workflows keep triggering each other in a loop?▼

GitHub Actions workflows trigger each other in a loop when automated outputs like pushes or pull requests bypass default infinite loop protection and re-activate interconnected workflows. Scanning .github/workflows/*.yml files identifies these cyclic trigger paths.

What is the best way to audit GitHub Actions workflows for cyclic trigger paths?▼

The best way to audit GitHub Actions workflows for cyclic trigger paths is a runtime audit workflow that scans existing .github/workflows/*.yml files for hard-to-detect mutual A→B→A loops, validating guard implementation and eliminating cyclic triggers.

How do I stop an auto-commit workflow from re-triggering itself in GitHub Actions?▼

To stop an auto-commit workflow from re-triggering itself in GitHub Actions, verify the push event won't re-trigger the same workflow and add a [skip ci] guard. This eliminates the cyclic trigger path and prevents the infinite loop risk.

Does GitHub's default infinite loop protection cover workflow_run and repository_dispatch events?▼

GitHub's default infinite loop protection can be bypassed by workflow_run and repository_dispatch event triggers. You need to validate guard implementation and scan for cyclic trigger paths between interconnected workflows to eliminate recursive loops.