add-static-analysis-workflow.py- Primary script to add/update static analysis workflow in a single repository- Detects default branch automatically
- Validates YAML syntax
- Compares with existing files
- Creates tracking logs
- Usage:
python3 add-static-analysis-workflow.py [repo_path]
batch-add-workflows.py- Process multiple repositories at once- Sequential or parallel execution
- Consolidated reporting
- Handles failures gracefully
- Usage:
python3 batch-add-workflows.py --repos repo1 repo2or--repo-file repos.txt
test_workflow_implementation.py- Core functionality tests- Tests script execution
- Verifies file creation
- Checks idempotency
- Validates tracking logs
- Run:
python3 test_workflow_implementation.py
integration_test.py- End-to-end testing- Creates temporary test repositories
- Tests branch detection
- Verifies batch processing
- Tests YAML validation
- Run:
python3 integration_test.py
README.md- Repository overview with quick startQUICKSTART.md- 5-minute quick start guideWORKFLOW_AUTOMATION.md- Complete reference documentation
requirements.txt- Python dependencies (PyYAML).gitignore- Git ignore patterns
examples/repos-example.txt- Example repository list formatexamples/usage-examples.sh- Common usage scenarios
.github/workflows/static-analysis.yaml- The standardized workflow- Uses shared OpsLevel template
- Configured with detected default branch
- Triggers on push and pull_request
tracking-log.json- Operation history- Timestamps
- Actions taken (created/updated/skipped)
- Branch information
- Success/failure status
batch-report.json- Consolidated batch processing report- Summary statistics
- Individual repository results
- Error details
The automation creates this standardized workflow:
name: Static Analysis
on:
push:
branches:
- [detected-branch]
pull_request:
branches:
- [detected-branch]
jobs:
static-analysis:
uses: opslevel/.github/.github/workflows/static-analysis.yaml@main- Python 3.7+
- PyYAML 6.0+
- Git
python3 add-static-analysis-workflow.py /path/to/repopython3 add-static-analysis-workflow.py --dry-runpython3 batch-add-workflows.py --repo-file repos.txtpython3 batch-add-workflows.py --repo-file repos.txt --parallel --max-workers 8python3 test_workflow_implementation.py
python3 integration_test.pyFor detailed usage instructions, see:
- QUICKSTART.md - Quick start guide
- WORKFLOW_AUTOMATION.md - Full documentation