App-GHGen

 view release on metacpan or  search on metacpan

lib/App/GHGen.pm  view on Meta::CPAN

=item * B<Auto-fix issues> - Automatically applies fixes for detected problems (adds caching, updates versions, adds permissions, etc.)

=item * B<Interactive customization> - Guided workflow creation with smart defaults and multi-select options

=item * B<Cost estimation> - Estimates current CI minutes usage and calculates potential savings from optimizations

=item * B<GitHub Action integration> - Run as a GitHub Action to analyze PRs, comment with suggestions, and create fix PRs

=item * B<Per-workflow breakdown> - Detailed analysis of each workflow's cost and optimization potential

=back

=head1 INSTALLATION

=head2 From CPAN

    cpanm App::GHGen

=head2 From Source

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

=head2 Quick Install Script

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

=head1 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.

=head1 WORKFLOW GENERATION

=head2 Auto-Detection

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

    ghgen generate --auto

Detection looks for:

=over 4

=item * B<Perl>: cpanfile, dist.ini, Makefile.PL, Build.PL, lib/*.pm

=item * B<Node.js>: package.json, package-lock.json, yarn.lock

=item * B<Python>: requirements.txt, setup.py, pyproject.toml

=item * B<Rust>: Cargo.toml, Cargo.lock

=item * B<Go>: go.mod, go.sum

=item * B<Ruby>: Gemfile, Rakefile

=item * B<Docker>: Dockerfile, docker-compose.yml

=back

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]:

=head2 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

=head2 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



( run in 1.194 second using v1.01-cache-2.11-cpan-39bf76dae61 )