App-GHGen

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


## Key Features

- **Auto-detect project type** - Intelligently scans your repository to detect language and dependencies
- **Generate optimized workflows** - Creates workflows with caching, security, concurrency, and best practices built-in
- **Analyze existing workflows** - Comprehensive analysis for performance, security, cost, and maintenance issues
- **Auto-fix issues** - Automatically applies fixes for detected problems (adds caching, updates versions, adds permissions, etc.)
- **Interactive customization** - Guided workflow creation with smart defaults and multi-select options
- **Cost estimation** - Estimates current CI minutes usage and calculates potential savings from optimizations
- **GitHub Action integration** - Run as a GitHub Action to analyze PRs, comment with suggestions, and create fix PRs
- **Per-workflow breakdown** - Detailed analysis of each workflow's cost and optimization potential

# INSTALLATION

## From CPAN

    cpanm App::GHGen

## From Source

    git clone https://github.com/nigelhorne/App-GHGen.git
    cd ghgen
    cpanm --installdeps .
    perl Makefile.PL
    make
    make test
    make install

## Quick Install Script

    curl -L https://cpanmin.us | perl - App::GHGen

# QUICK START

The fastest way to get started:

    # Navigate to your project
    cd my-project/

    # Auto-detect and generate workflow
    ghgen generate --auto

    # Review the generated workflow
    cat .github/workflows/*-ci.yml

    # Commit and push
    git add .github/workflows/
    git commit -m "Add CI workflow"
    git push

That's it! GHGen will detect your project type and create an optimized workflow.

# WORKFLOW GENERATION

## Auto-Detection

GHGen can automatically detect your project type by scanning for indicator files:

    ghgen generate --auto

Detection looks for:

- **Perl**: cpanfile, dist.ini, Makefile.PL, Build.PL, lib/\*.pm
- **Node.js**: package.json, package-lock.json, yarn.lock
- **Python**: requirements.txt, setup.py, pyproject.toml
- **Rust**: Cargo.toml, Cargo.lock
- **Go**: go.mod, go.sum
- **Ruby**: Gemfile, Rakefile
- **Docker**: Dockerfile, docker-compose.yml

If multiple types are detected, it shows alternatives:

    ✓ Detected project type: PERL
      Evidence: cpanfile, lib, t

    Other possibilities:
      • docker (confidence: 65%)

    Generate PERL workflow? [Y/n]:

## Specify Project Type

Generate for a specific language:

    ghgen generate --type=perl
    ghgen generate --type=node
    ghgen generate --type=python
    ghgen generate --type=rust
    ghgen generate --type=go
    ghgen generate --type=ruby
    ghgen generate --type=docker
    ghgen generate --type=static

## Interactive Mode

Choose from a menu of available types:

    ghgen generate --interactive

    GitHub Actions Workflow Generator
    ==================================================

    Select a project type:

      1. Node.js/npm
      2. Python
      3. Rust
      4. Go
      5. Ruby
      6. Perl
      7. Docker
      8. Static site (GitHub Pages)

    Enter number (1-8):

## Interactive Customization

Customize workflows with guided prompts:

    ghgen generate --type=perl --customize



( run in 0.628 second using v1.01-cache-2.11-cpan-6aa56a78535 )