mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-01-26 11:14:04 +00:00
* feat: enhance gen command with directory/file arguments and custom output filenames - Add positional argument support for targeting specific directories or files - Add --output flag for custom output filename specification - Implement resolveOutputPath method to handle absolute and relative custom paths - Update CLI interface with comprehensive examples and help text - Fix race condition in FixtureManager cache access with RWMutex synchronization - Update .gitignore to cover additional generated file types (html, json) - Maintain backward compatibility with existing gen command usage This enhancement enables generating documentation for multiple actions in the same directory without filename conflicts, while supporting flexible file targeting. * feat: enhance CI workflow and standardize license filename - Update CI workflow to use new gen command functionality with directory targeting - Remove working-directory requirement by using positional arguments - Add comprehensive documentation generation with multiple formats (md, html, json) - Test single file targeting and recursive generation with themes - Add artifact upload for generated documentation files - Standardize license filename from LICENSE.md to LICENSE following GitHub conventions - Clean up duplicate license files The enhanced workflow demonstrates all new gen command features including directory targeting, custom output filenames, multiple formats, and themes. * fix: resolve all linting and EditorConfig violations Fixed remaining code quality issues: - Line length violation in TODO.md by breaking long summary - Trailing whitespace removal from CI workflow, CLAUDE.md, and TODO.md - Indentation consistency fixes in CI workflow YAML - Security workflow cleanup for better formatting All linters now pass: - golangci-lint: 0 issues - EditorConfig: No violations detected Project maintains enterprise-grade code quality standards. * refactor: optimize security workflow by removing Snyk and reducing duplication Streamlined security scanning workflow: - Remove Snyk job to eliminate redundancy with govulncheck and Trivy - Add comprehensive coverage documentation explaining each tool's purpose - Ensure consistent action version pinning across all jobs - Maintain complete security protection with govulncheck, Trivy, gitleaks, and dependency-review Benefits: - Reduced execution time by ~2-3 minutes per workflow run - Simplified secret management (no SNYK_TOKEN required) - Lower complexity while maintaining enterprise-grade security coverage - Better workflow maintainability with clear job documentation Security coverage remains comprehensive with Go-specific vulnerability scanning, multi-language dependency analysis, secrets detection, and PR-level dependency review.
115 lines
3.9 KiB
Makefile
115 lines
3.9 KiB
Makefile
.PHONY: help test lint run example clean readme config-verify security vulncheck audit snyk trivy gitleaks \
|
|
editorconfig editorconfig-fix format
|
|
|
|
all: help
|
|
|
|
help: ## Show this help message
|
|
@echo "GitHub Action README Generator - Available Make Targets:"
|
|
@echo ""
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
|
|
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
|
@echo ""
|
|
@echo "Common workflows:"
|
|
@echo " make test lint # Run tests and linting"
|
|
@echo " make format # Format code and fix EditorConfig issues"
|
|
@echo " make security # Run all security scans"
|
|
|
|
test: ## Run all tests
|
|
go test ./...
|
|
|
|
lint: format ## Run linter (after formatting)
|
|
golangci-lint run || true
|
|
|
|
config-verify: ## Verify golangci-lint configuration
|
|
golangci-lint config verify --verbose
|
|
|
|
run: ## Run the application
|
|
go run .
|
|
|
|
example: ## Generate example README
|
|
go run . gen --config config.yml --output-format=md
|
|
|
|
readme: ## Generate project README
|
|
go run . gen --config config.yml --output-format=md
|
|
|
|
clean: ## Clean build artifacts
|
|
rm -rf dist/
|
|
|
|
# Code formatting and EditorConfig targets
|
|
format: editorconfig-fix ## Format code and fix EditorConfig issues
|
|
@echo "Running all formatters..."
|
|
@command -v gofmt >/dev/null 2>&1 && gofmt -w -s . || echo "gofmt not available"
|
|
@command -v goimports >/dev/null 2>&1 && \
|
|
goimports -w -local github.com/ivuorinen/gh-action-readme . || \
|
|
echo "goimports not available"
|
|
|
|
editorconfig: ## Check EditorConfig compliance
|
|
@echo "Checking EditorConfig compliance..."
|
|
@command -v eclint >/dev/null 2>&1 || \
|
|
{ echo "Please install eclint: npm install -g eclint"; exit 1; }
|
|
@echo "Checking files for EditorConfig compliance..."
|
|
@find . -type f \( \
|
|
-name "*.go" -o \
|
|
-name "*.yml" -o \
|
|
-name "*.yaml" -o \
|
|
-name "*.json" -o \
|
|
-name "*.md" -o \
|
|
-name "Makefile" -o \
|
|
-name "*.tmpl" -o \
|
|
-name "*.adoc" -o \
|
|
-name "*.sh" \
|
|
\) -not -path "./.*" -not -path "./gh-action-readme" -not -path "./coverage*" \
|
|
-not -path "./testutil.test" -not -path "./test_*" | \
|
|
xargs eclint check
|
|
|
|
editorconfig-fix: ## Fix EditorConfig violations
|
|
@echo "Fixing EditorConfig violations..."
|
|
@command -v eclint >/dev/null 2>&1 || \
|
|
{ echo "Please install eclint: npm install -g eclint"; exit 1; }
|
|
@echo "Fixing files for EditorConfig compliance..."
|
|
@find . -type f \( \
|
|
-name "*.go" -o \
|
|
-name "*.yml" -o \
|
|
-name "*.yaml" -o \
|
|
-name "*.json" -o \
|
|
-name "*.md" -o \
|
|
-name "Makefile" -o \
|
|
-name "*.tmpl" -o \
|
|
-name "*.adoc" -o \
|
|
-name "*.sh" \
|
|
\) -not -path "./.*" -not -path "./gh-action-readme" -not -path "./coverage*" \
|
|
-not -path "./testutil.test" -not -path "./test_*" | \
|
|
xargs eclint fix
|
|
|
|
# Security targets
|
|
security: vulncheck snyk trivy gitleaks ## Run all security scans
|
|
@echo "All security scans completed"
|
|
|
|
vulncheck: ## Run Go vulnerability check
|
|
@echo "Running Go vulnerability check..."
|
|
@command -v govulncheck >/dev/null 2>&1 || \
|
|
{ echo "Installing govulncheck..."; go install golang.org/x/vuln/cmd/govulncheck@latest; }
|
|
govulncheck ./...
|
|
|
|
audit: vulncheck ## Run comprehensive security audit
|
|
@echo "Running comprehensive security audit..."
|
|
go list -json -deps ./... | jq -r '.Module | select(.Path != null) | .Path + "@" + .Version' | sort -u
|
|
|
|
snyk: ## Run Snyk security scan
|
|
@echo "Running Snyk security scan..."
|
|
@command -v snyk >/dev/null 2>&1 || \
|
|
{ echo "Please install Snyk CLI: npm install -g snyk"; exit 1; }
|
|
snyk test --file=go.mod --package-manager=gomodules
|
|
|
|
trivy: ## Run Trivy filesystem scan
|
|
@echo "Running Trivy filesystem scan..."
|
|
@command -v trivy >/dev/null 2>&1 || \
|
|
{ echo "Please install Trivy: https://aquasecurity.github.io/trivy/"; exit 1; }
|
|
trivy fs . --severity HIGH,CRITICAL
|
|
|
|
gitleaks: ## Run gitleaks secrets detection
|
|
@echo "Running gitleaks secrets detection..."
|
|
@command -v gitleaks >/dev/null 2>&1 || \
|
|
{ echo "Please install gitleaks: https://github.com/gitleaks/gitleaks"; exit 1; }
|
|
gitleaks detect --source . --verbose
|