Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 26, 2025

This PR adds an officially supported GitHub Action that makes it easy to integrate go-covercheck into CI/CD workflows.

What's Added

GitHub Action (action.yml)

  • Composite action using go install for fast, reliable installation
  • Comprehensive input support for all major go-covercheck flags:
    • Coverage file path, config file, thresholds
    • Output formats, skip patterns, history functionality
    • Version pinning support
  • Proper argument handling with validation and error checking
  • PATH management to ensure installed binary is accessible

Documentation & Examples

  • Updated README with complete GitHub Action documentation
  • Input parameter reference with descriptions and defaults
  • Multiple usage examples covering common scenarios:
    • Basic usage with default settings
    • Custom thresholds and output formats
    • Skip patterns and history tracking
  • Sample workflow file (samples/github-action-workflow.yml) for easy copying

Testing Infrastructure

  • Test workflow (.github/workflows/test-action.yml) to validate action functionality
  • Multiple test scenarios covering different input combinations
  • Local validation to ensure script works correctly

Usage

steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-go@v5
    with:
      go-version: '1.24'
  - run: go test -v -coverprofile=coverage.out ./...
  - uses: mach6/go-covercheck@v1
    with:
      coverage-file: coverage.out
      statement-threshold: "80"
      block-threshold: "70"

The action leverages the existing go install approach used in the project's CI, ensuring consistency and reliability while providing a clean, user-friendly interface for GitHub Actions workflows.

Fixes #15.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] [Feature] create GitHub action that runs go-covercheck Add GitHub Action for go-covercheck Jul 26, 2025
Copilot AI requested a review from mach6 July 26, 2025 03:42
Copilot finished work on behalf of mach6 July 26, 2025 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] create GitHub action that runs go-covercheck

2 participants