Files
gh-action-readme/.github/workflows/ci.yml
Ismo Vuorinen f3693e67fc feat: gen command enhancements, race condition fixes, workflow tweaks (#21)
* 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.
2025-08-06 09:38:03 +03:00

66 lines
2.6 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v4.2.2
- name: Set up Go
uses: actions/setup-go@v5 # v5.5.0
- name: Install dependencies
run: go mod tidy
- name: Setup Node.js for EditorConfig tools
uses: actions/setup-node@v4 # v4.4.0
with:
node-version: '18'
- name: Install EditorConfig tools
run: npm install -g eclint
- name: Check EditorConfig compliance
run: eclint check .
- name: Run unit tests
run: go test ./...
- name: Example Action Readme Generation
run: |
go run . gen testdata/example-action --output example-README.md
- name: Comprehensive Documentation Generation
run: |
# Create docs directory
mkdir -p docs
# Generate multiple formats for different actions to demonstrate new functionality
echo "Generating documentation for example-action..."
go run . gen testdata/example-action/ --output $PWD/docs/example-action.md
go run . gen testdata/example-action/ -f html --output $PWD/docs/example-action.html
go run . gen testdata/example-action/ -f json --output $PWD/docs/example-action.json
echo "Generating documentation for composite-action..."
go run . gen testdata/composite-action/ --output $PWD/docs/composite-action.md
go run . gen testdata/composite-action/ -f html --output $PWD/docs/composite-action.html
# Test single file targeting
echo "Generating from specific action.yml files..."
go run . gen testdata/example-action/action.yml --output $PWD/docs/direct-example.md
go run . gen testdata/composite-action/action.yml --output $PWD/docs/direct-composite.md
# Test recursive generation with different themes
echo "Testing recursive generation with themes..."
go run . gen testdata/ --recursive --theme minimal -f html --output $PWD/docs/all-actions-minimal.html
go run . gen testdata/ --recursive --theme professional -f json --output $PWD/docs/all-actions-professional.json
# Verify files were generated
echo "Verifying generated documentation files..."
ls -la docs/
- name: Upload Generated Documentation
uses: actions/upload-artifact@v4 # v4.4.3
if: always()
with:
name: generated-documentation
path: |
docs/
testdata/example-action/example-README.md
retention-days: 7