A comprehensive template for repository health checking using Taskfile, act, and OSSF Scorecard.
To integrate this template into your existing project, follow these steps:
# Create third_party directory for external dependencies
mkdir -p third_party
# Add the template as a git submodule
git submodule add git@github.com:allenday/taskfile-repo-template.git third_party/taskfile-repo-template# Create required directories
mkdir -p taskfiles scripts/task
# Create your main Taskfile.yml (includes template modules)
cat > Taskfile.yml << 'EOF'
version: '3'
includes:
# Core repository health and CI tasks (always included)
core:
taskfile: ./taskfiles/Core.yml
dir: .
# Optional technology-specific extensions
python:
taskfile: ./taskfiles/Python.yml
optional: true
aliases: [py]
protobuf:
taskfile: ./taskfiles/Protobuf.yml
optional: true
aliases: [proto, pb]
# Container orchestration (optional)
container:
taskfile: ./taskfiles/Container.yml
optional: true
aliases: [docker]
# Secret management
secrets:
taskfile: ./taskfiles/Secrets.yml
optional: true
aliases: [bws]
# Application-specific tasks (customize for your project)
app:
taskfile: ./taskfiles/App.yml
aliases: [myapp] # Replace with your app name
vars:
REPO_OWNER:
sh: ./scripts/task/detect-repo.sh | grep REPO_OWNER | cut -d= -f2
REPO_NAME:
sh: ./scripts/task/detect-repo.sh | grep REPO_NAME | cut -d= -f2
tasks:
default:
desc: List all available tasks across modules
cmds:
- task --list
doctor:
desc: Complete repository health check (core + technology-specific)
cmds:
- echo "🏥 COMPREHENSIVE REPOSITORY HEALTH CHECK"
- echo "========================================"
- echo ""
- task core:doctor || echo "⚠️ Core health check found issues (see above)"
- echo ""
- task container:doctor 2>/dev/null || echo "⏭️ Container checks skipped (no container environment detected)"
- echo ""
- task python:doctor 2>/dev/null || echo "⏭️ Python checks skipped (no Python project detected)"
- echo ""
- task protobuf:doctor 2>/dev/null || echo "⏭️ Protobuf checks skipped (no protobuf project detected)"
- echo ""
- task secrets:doctor 2>/dev/null || echo "⏭️ Secrets checks skipped (Bitwarden Secrets not configured)"
- echo ""
- echo "🎉 COMPREHENSIVE HEALTH CHECK COMPLETED"
- echo "========================================"
EOF# Symlink template taskfiles to your taskfiles directory
cd taskfiles
ln -sf ../third_party/taskfile-repo-template/taskfiles/Core.yml Core.yml
ln -sf ../third_party/taskfile-repo-template/taskfiles/Python.yml Python.yml
ln -sf ../third_party/taskfile-repo-template/taskfiles/Protobuf.yml Protobuf.yml
ln -sf ../third_party/taskfile-repo-template/taskfiles/Container.yml Container.yml
ln -sf ../third_party/taskfile-repo-template/taskfiles/Secrets.yml Secrets.yml
# Symlink template scripts to your scripts directory
cd ../scripts/task
ln -sf ../../third_party/taskfile-repo-template/scripts/task/check-tools.sh check-tools.sh
ln -sf ../../third_party/taskfile-repo-template/scripts/task/detect-repo.sh detect-repo.sh
ln -sf ../../third_party/taskfile-repo-template/scripts/task/core core
ln -sf ../../third_party/taskfile-repo-template/scripts/task/python python
ln -sf ../../third_party/taskfile-repo-template/scripts/task/protobuf protobuf
ln -sf ../../third_party/taskfile-repo-template/scripts/task/container container
ln -sf ../../third_party/taskfile-repo-template/scripts/task/secrets secrets
# Go back to project root
cd ../..# Create your application-specific taskfile
cat > taskfiles/App.yml << 'EOF'
version: '3'
vars:
APP_NAME: 'myapp' # Replace with your application name
tasks:
setup:
desc: Setup application environment
cmds:
- echo "Setting up {{.APP_NAME}}..."
# Add your application setup commands here
test:
desc: Run application tests
cmds:
- echo "Running {{.APP_NAME}} tests..."
# Add your test commands here
deploy:
desc: Deploy application
cmds:
- echo "Deploying {{.APP_NAME}}..."
# Add your deployment commands here
doctor:
desc: Application health check
cmds:
- echo "🔍 {{.APP_NAME}} HEALTH CHECK"
- echo "========================="
# Add your application-specific health checks here
- echo "✅ Application health check completed"
EOF# Create .github/workflows directory if it doesn't exist
mkdir -p .github/workflows
# Copy template workflows (customize as needed)
cp third_party/taskfile-repo-template/.github/workflows/ci.yml .github/workflows/
cp third_party/taskfile-repo-template/.github/workflows/health-check.yml .github/workflows/
# Customize workflows for your project needs# Add all changes to git
git add .
# Test the integration
task --list # Should show all available tasks
task core:doctor # Test core health checks
task doctor # Run comprehensive health check
# Commit the integration
git commit -m "feat: integrate taskfile-repo-template
- Add template as git submodule
- Create modular Taskfile.yml with optional includes
- Symlink template taskfiles and scripts
- Add application-specific App.yml taskfile
- Enable comprehensive health monitoring with task doctor"This template implements a 5-dimensional resource naming pattern to organize secrets, configuration, and deployment artifacts in a consistent, scalable way.
All resources follow this naming convention:
${CONCERN}_${NETWORK}_${ENVIRONMENT}_${COMPONENT}_${RESOURCE}
Dimensions explained:
- CONCERN: What domain/system the resource belongs to (
DEPLOY,CHAIN,API) - NETWORK: Where the resource is used (
LOCAL,CLOUD,INTRANET) - ENVIRONMENT: Lifecycle stage (
DEV,STAGING,PROD) - COMPONENT: Application part (
VALIDATOR,DAPP,API) - RESOURCE: Actual config/secret (
PRIVATE_KEY,URL,TOKEN)
Examples:
DEPLOY_LOCAL_DEV_VALIDATOR_PRIVATE_KEY # Local development validator private key
DEPLOY_CLOUD_PROD_DAPP_CDN_URL # Production dApp CDN URL
CHAIN_BASE_SEPOLIA_STAGING_CONTRACTS_RPC_URL # Staging blockchain RPC endpoint
API_CLOUD_PROD_GITHUB_TOKEN # Production GitHub API tokenOrganize your directories to match the resource naming pattern:
src/main/
├── typescript/
│ ├── validator/ # DEPLOY_*_*_VALIDATOR_* resources
│ └── dapp/ # DEPLOY_*_*_DAPP_* resources
└── solidity/ # CHAIN_*_*_CONTRACTS_* resources
deploy/
├── local/ # DEPLOY_LOCAL_*_*_* configs
│ ├── dev/
│ │ ├── validator/
│ │ └── dapp/
│ ├── staging/
│ └── prod/
└── cloud/ # DEPLOY_CLOUD_*_*_* configs
├── dev/
├── staging/
└── prod/
Define your project's 5D grid in your main Taskfile.yml:
vars:
# 5-dimensional resource configuration
# Pattern: ${CONCERN}_${NETWORK}_${ENVIRONMENT}_${COMPONENT}_${RESOURCE}
CONCERNS:
- deploy
- chain
- api
NETWORKS:
- local
- cloud
ENVIRONMENTS:
- dev
- staging
- prod
COMPONENTS:
- validator
- dapp- Intuitive navigation: Directory structure matches resource names
- Scalable organization: Clear patterns that grow with project complexity
- Consistent tooling: Template scripts work across all resource types
- Clear mental model: Developers quickly understand where things belong
- Automation friendly: Scripts can iterate over the full grid for validation
The template's secret resolution follows the 5D hierarchy, trying:
- Environment variables (highest precedence)
.envfiles (medium precedence)- Bitwarden Secrets Manager (lowest precedence, authoritative)
Use task secrets:resolve SECRET_ITEM=GITHUB_TOKEN to test resolution.
-
Initialize the repository:
task init
-
Install required tools:
task setup
-
Run health check:
task doctor
The template includes a comprehensive health monitoring system with specialized doctor scripts for different technology domains:
task core:doctor # Repository, Git, CLI tools
task container:doctor # Docker, Compose, deployments
task python:doctor # Virtual environments, dependencies
task protobuf:doctor # Protocol Buffers tooling, project structure
task secrets:doctor # Bitwarden Secrets Manager integrationtask doctor # Runs all applicable health checks with smart detectionThe unified doctor automatically detects your project type and runs relevant checks:
- ✅ Always runs: Core repository health checks
- 🔍 Auto-detects: Container environments (Docker, Kubernetes)
- 🐍 Auto-detects: Python projects (requirements.txt, pyproject.toml)
- ⚡ Auto-detects: Protobuf projects (proto/ directory, *.proto files)
- 🔐 Configurable: Bitwarden Secrets (BWS_ACCESS_TOKEN, BWS_PROJECT_ID)
$ task doctor
🏥 COMPREHENSIVE REPOSITORY HEALTH CHECK
========================================
🏥 CORE REPOSITORY HEALTH CHECK
===============================
✅ Git: 2.43.0
✅ GitHub CLI: 2.74.2
✅ GitHub Auth: Authenticated as username
⚠️ OSSF Scorecard: Not installed (optional)
🔍 CONTAINER ENVIRONMENT HEALTH CHECK
=====================================
✅ Docker: 24.0.7 (running)
✅ Docker Compose: 2.38.2 (built-in)
✅ deploy/docker-compose.yml syntax is valid
🐍 PYTHON DEVELOPMENT ENVIRONMENT HEALTH CHECK
==============================================
ℹ️ No Python project detected - skipping Python health checks
🎉 COMPREHENSIVE HEALTH CHECK COMPLETED
========================================Run task --list to see all available tasks.
task doctor- Complete repository health checktask ci- Run CI pipeline locally with acttask scorecard- Run OSSF Scorecard security analysistask report- Generate comprehensive health report
task deploy ENV=prod VISIBILITY=private- Deploy to specific environmenttask setup-repo ENV=staging VISIBILITY=public- Bootstrap repository setup
task setup- Install all required tools (act, scorecard, gh CLI)task install-act- Install nektos/act for local CI testingtask install-scorecard- Install OSSF Scorecard for security analysis
This template supports multi-tier deployments:
dev- Development environmentstaging- Pre-production environmentprod- Production environment
private- Internal/intranet deploymentpublic- Public/internet deployment
# Deploy to private development
task deploy ENV=dev VISIBILITY=private
# Deploy to public production
task deploy ENV=prod VISIBILITY=public
# Setup secrets for staging environment
task setup-repo ENV=staging VISIBILITY=private.github/workflows/ci.yml- Main CI pipeline.github/workflows/health-check.yml- Weekly repository health check.github/workflows/scorecard.yml- OSSF Scorecard security analysis
The template will help you configure:
- Secrets Management - Repository and environment-specific secrets
- Environments - GitHub deployment environments with protection rules
- Branch Protection - Required status checks and PR reviews
- Security Scanning - OSSF Scorecard integration
# Test CI workflow
task ci
# Test specific workflow
task ci-workflow WORKFLOW=ci.yml
# Debug workflow issues
task ci-debug
# List available workflows
task ci-list# Run complete health check
task doctor
# Generate detailed report
task report
# Check specific components
./scripts/check-secrets.sh
./scripts/check-environments.sh
./scripts/check-branch-protection.shAll health check logic is in scripts/ directory:
check-secrets.sh- Validates GitHub secrets configurationcheck-environments.sh- Validates GitHub environmentscheck-branch-protection.sh- Validates branch protection rulescheck-workflows.sh- Validates GitHub Actions workflowsdeploy.sh- Handles multi-environment deploymentssetup-*.sh- Bootstrap scripts for repository configuration
Edit Taskfile.yml to customize:
- Repository owner/name variables
- Default environment values
- Tool installation methods
- Deployment logic
- Homebrew (macOS) or Go for tool installation
- GitHub CLI for repository management
- Git repository with GitHub remote
-
Permission denied on scripts
task init # Re-run to fix permissions -
GitHub CLI not authenticated
gh auth login
-
act workflows failing
task ci-debug # Run with verbose output
-
Symlinks not working
# Check if symlinks are created correctly ls -la taskfiles/ ls -la scripts/task/ # Recreate broken symlinks rm -f taskfiles/Core.yml ln -sf ../third_party/taskfile-repo-template/taskfiles/Core.yml taskfiles/Core.yml
-
Submodule update issues
# Update submodule to latest git submodule update --remote third_party/taskfile-repo-template # Initialize submodules after cloning git submodule update --init --recursive
-
Task not found errors
# Verify taskfile includes are correct task --list # Check for missing symlinks task core:doctor 2>&1 | grep "No such file"
-
Permission denied on scripts
# Fix script permissions chmod +x scripts/task/*/doctor.sh chmod +x third_party/taskfile-repo-template/scripts/task/*/doctor.sh
- Run
task --listfor available commands - Check
task doctoroutput for specific issues - Review generated
repository-health-report.md - Verify symlinks:
ls -la taskfiles/ scripts/task/
This template integrates with:
- nektos/act - Local GitHub Actions testing
- OSSF Scorecard - Security posture analysis
- GitHub CLI - Repository management automation
- Taskfile - Modern task runner with named arguments
Perfect for teams wanting comprehensive repository health monitoring with local testing capabilities.
Create domain-specific health checks for your technology stack:
# Create custom doctor script
mkdir -p scripts/task/mytech
cat > scripts/task/mytech/doctor.sh << 'EOF'
#!/bin/bash
set -euo pipefail
echo "🔍 MY TECHNOLOGY HEALTH CHECK"
echo "============================"
echo ""
# Check if project uses your technology
if [ ! -f "mytech.config" ]; then
echo "ℹ️ No MyTech project detected - skipping checks"
exit 0
fi
# Add your health checks here
echo "✅ MyTech configuration valid"
echo "✅ MyTech dependencies installed"
echo ""
echo "🎯 Summary: MyTech environment is healthy"
EOF
chmod +x scripts/task/mytech/doctor.shExtend the template with your own taskfile modules:
# Create custom taskfile
cat > taskfiles/MyTech.yml << 'EOF'
version: '3'
vars:
MYTECH_CONFIG: mytech.config
tasks:
doctor:
desc: MyTech development environment health check
cmds:
- ./scripts/task/mytech/doctor.sh
setup:
desc: Setup MyTech development environment
cmds:
- echo "Setting up MyTech..."
- # Add setup commands
test:
desc: Run MyTech tests
cmds:
- echo "Running MyTech tests..."
- # Add test commands
EOFThen include it in your main Taskfile.yml:
includes:
mytech:
taskfile: ./taskfiles/MyTech.yml
optional: true
aliases: [mt]Create environment-specific configurations:
# Development environment
export BWS_ACCESS_TOKEN="your-dev-token"
export BWS_PROJECT_ID="your-dev-project-id"
# Production environment
export BWS_ACCESS_TOKEN="your-prod-token"
export BWS_PROJECT_ID="your-prod-project-id"
# Test all environments
for env in dev staging prod; do
echo "Testing $env environment..."
ENV=$env task doctor
doneTo contribute improvements back to the template:
- Fork the repository
- Create a feature branch
- Add your improvements (new doctor scripts, taskfiles, etc.)
- Test with multiple project types
- Submit a pull request
The template is designed to be extensible and welcomes contributions for new technology domains!