Skip to content

Add reusable GitHub workflow and action for automated code quality analysis - #1

Merged
ZhulongNT merged 4 commits into
mainfrom
copilot/fix-a6b7f548-d371-4980-bff8-89b8a139ed1f
Sep 28, 2025
Merged

ZhulongNT merged 4 commits into
mainfrom
copilot/fix-a6b7f548-d371-4980-bff8-89b8a139ed1f

Conversation

Copilot AI commented Sep 28, 2025 •

Copy link
Copy Markdown

This PR implements a comprehensive solution for running fuck-u-code analysis in GitHub workflows with automatic markdown report generation and artifact storage.

🚀 New Features

Reusable GitHub Workflow

A complete workflow that can be called from any repository:

jobs:
  quality-check:
    uses: ZhulongNT/fuck-u-code/.github/workflows/code-quality-analysis.yml@main
    with:
      language: 'en-US'
      top-files: 10
      artifact-name: 'code-quality-report'

GitHub Composite Action

For advanced integration scenarios with structured outputs:

- name: Code Quality Analysis
  id: quality
  uses: ZhulongNT/fuck-u-code@main
  with:
    path: './src'
    language: 'en-US'
    
- name: Quality Gate
  run: |
    if (( $(echo "${{ steps.quality.outputs.quality-score }} > 80" | bc -l) )); then
      echo "Quality gate failed!"
      exit 1
    fi

📋 Key Capabilities

  • Zero Setup: Works immediately in any repository without additional configuration
  • Full Configuration Support: All fuck-u-code CLI options available as workflow inputs
  • Automatic Artifacts: Markdown reports automatically uploaded with configurable retention
  • Rich Job Summaries: Key metrics displayed directly in GitHub Actions UI
  • Multi-language Reports: Support for both Chinese (zh-CN) and English (en-US)
  • Quality Gates: Built-in outputs for conditional builds based on quality scores

📊 Workflow Inputs

The reusable workflow supports all standard fuck-u-code options:

Input Default Description
path . Path to analyze
language en-US Report language (zh-CN/en-US)
top-files 5 Number of top problematic files
max-issues 5 Issues per file to display
verbose false Enable detailed output
exclude-patterns '' Space-separated exclude patterns
artifact-name code-quality-report Artifact name

📁 Files Added

  • .github/workflows/code-quality-analysis.yml - Main reusable workflow
  • action.yml - Composite action for direct use
  • GITHUB_WORKFLOW.md - Comprehensive documentation
  • examples/ - Ready-to-use workflow templates
  • Updated README.md and README_EN.md with GitHub Actions integration

🔧 Example Use Cases

Basic CI/CD Integration:

on: [push, pull_request]
jobs:
  quality:
    uses: ZhulongNT/fuck-u-code/.github/workflows/code-quality-analysis.yml@main

Monorepo Analysis:

jobs:
  backend:
    uses: ZhulongNT/fuck-u-code/.github/workflows/code-quality-analysis.yml@main
    with:
      path: './backend'
      exclude-patterns: '**/*.test.go vendor/**'
      
  frontend:
    uses: ZhulongNT/fuck-u-code/.github/workflows/code-quality-analysis.yml@main
    with:
      path: './frontend/src'
      skip-index: true

The implementation provides both beginner-friendly reusable workflows and advanced composite actions for teams wanting to integrate automated code quality analysis into their CI/CD pipelines.

Original prompt

create a reuseable github workflow that allows running fuck-u-code in others workflow and output markdown report to artifacts


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits September 28, 2025 03:11
Co-authored-by: ZhulongNT <191720247+ZhulongNT@users.noreply.github.com>
Co-authored-by: ZhulongNT <191720247+ZhulongNT@users.noreply.github.com>
Copilot AI changed the title [WIP] create a reuseable github workflow that allows running fuck-u-code in others workflow and output markdown report to artifacts Add reusable GitHub workflow and action for automated code quality analysis Sep 28, 2025
Copilot AI requested a review from ZhulongNT September 28, 2025 03:18
@ZhulongNT
ZhulongNT marked this pull request as ready for review September 28, 2025 03:24
@ZhulongNT
ZhulongNT merged commit 0ba520c into main Sep 28, 2025
4 checks passed
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.

2 participants