Skip to content

gophersatwork/goverhaul-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goverhaul GitHub Action

This GitHub Action allows you to enforce architectural rules in your Go projects using Goverhaul.

Benefits

  • Enforce architecture: Ensure your codebase adheres to the intended architecture
  • CI/CD Integration: Seamlessly integrate architectural checks into your CI/CD pipeline
  • No installation required: The action handles installing Goverhaul for you
  • Customizable: Configure the action to match your project's specific needs

Usage

name: Architecture Check

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  goverhaul:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run Goverhaul
        uses: gophersatwork/goverhaul-action@main
        with:
          path: '.'
          config: '.goverhaul.yml'
          verbose: 'false'

Inputs

Input Description Required Default
path Path to lint No .
config Path to config file No .goverhaul.yml
verbose Enable verbose logging for debugging No false

Configuration

Create a .goverhaul.yml file in your project root to define architectural rules. Example:

# Basic configuration for a typical layered architecture
rules:
  # Domain layer should not depend on infrastructure
  - path: "internal/domain"
    prohibited:
      - name: "internal/infrastructure"
        cause: "Domain should not depend on infrastructure"

  # API layer should not access database directly
  - path: "internal/api"
    prohibited:
      - name: "internal/database"
        cause: "API should access database through domain services"

For more information on configuration options, see the Goverhaul documentation.

Advanced Examples

Using with a Custom Configuration Path

- name: Run Goverhaul
  uses: gophersatwork/goverhaul-action@main
  with:
    path: './src'
    config: './config/.goverhaul.yml'

Troubleshooting

Action fails with "Config File Not Found"

Make sure your configuration file exists at the path specified in the config input. If you're using a custom path, ensure it's relative to the repository root.

- name: Run Goverhaul
  uses: gophersatwork/goverhaul-action@main
  with:
    config: '.goverhaul.yml'  # This file must exist in your repository

Debugging Issues

Enable verbose logging to get more information about what's happening:

- name: Run Goverhaul
  uses: gophersatwork/goverhaul-action@main
  with:
    verbose: 'true'  # Enable verbose logging

About

This GitHub Action allows you to enforce architectural rules in your Go projects using Goverhaul

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors