.github is a special repository that defines reusable workflows and standards for all repositories in the Open Resilience Initiative. This is not just for PR validationβit's a framework for all automation across the organization.
- π PR Templates - Standardized templates for consistent pull requests
- π Issue Templates - Structured issue forms for bug reports, features, docs, and questions
- βοΈ Reusable Workflows - Centralized GitHub Actions for ANY automation need
- π·οΈ Label Configuration - Consistent labeling rules across all repositories
- π Documentation & Templates - Guidelines for creating new workflows
- π Centralized Management - Update once, apply everywhere automatically
π‘ Key Principle: Define workflows once in
.github, use them everywhere. This eliminates duplication and ensures consistency across all 16+ repositories.
| Workflow | Purpose | Used By |
|---|---|---|
pr-validation.yml |
PR validation, labeling, security scanning | All repositories |
create-labels.yml |
Create standardized labels | All repositories |
deploy-workflows.yml |
Deploy workflows to all repos | This repository only |
template-sync.yml |
Sync changes from template repository | Any repository created from template |
1. Define workflow in .github (this repository):
# .github/.github/workflows/my-workflow.yml name: My Reusable Workflow on: workflow_call: # Makes it reusable jobs: my-job: runs-on: ubuntu-latest steps: - name: Do something run: echo "Works everywhere!"
2. Call it from any repository:
# Any repository: .github/workflows/use-my-workflow.yml name: Use My Workflow on: push: branches: [main] jobs: call-workflow: uses: OpenResilienceInitiative/.github/.github/workflows/my-workflow.yml@main
Result: The workflow runs in that repository automatically!
Follow this pattern to create ANY new reusable workflow:
Location: .github/.github/workflows/your-workflow.yml
name: Your Workflow Name (Reusable) on: workflow_call: # Required: Makes it reusable inputs: optional-input: description: 'Optional input parameter' required: false type: string permissions: contents: read # Set minimum required permissions jobs: your-job: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Your step run: | echo "This workflow can be used by any repository" echo "Input: ${{ inputs.optional-input }}"
Location: .github/.github/workflows/your-workflow-caller.yml
This is the template that gets deployed to repositories:
name: Your Workflow Name on: push: # Trigger when you need it branches: [main] workflow_dispatch: # Optional: Manual trigger jobs: run-workflow: uses: OpenResilienceInitiative/.github/.github/workflows/your-workflow.yml@main with: optional-input: "value"
Update deploy-workflows.sh to include your new workflow:
# Add your workflow to the deploy script REPOS=(...all repos...) for repo in "${REPOS[@]}"; do # Copy your caller template cp your-workflow-caller.yml .github/workflows/your-workflow.yml done
That's it! Your workflow is now available across all repositories.
You can create reusable workflows for:
- β PR Validation (already implemented)
- β CI/CD Pipelines - Build, test, deploy
- β Security Scanning - SAST, dependency checks
- β Code Quality - Linting, formatting checks
- β Documentation - Auto-generate docs, check links
- β Label Management - Create/update labels (already implemented)
- β Template Syncing - Pull updates from template repos (already implemented)
- β Dependency Updates - Automated dependency management
- β Release Management - Automated versioning and releases
- β Any automation you need across multiple repos!
Pattern: If you need the same automation in multiple repositories, make it a reusable workflow in .github!
All pull requests automatically get:
- β
Semantic PR title validation (
feat:,fix:,docs:, etc.) - β PR body completeness checks
- β Auto-labeling (work type, area, priority, size)
- β Security scanning (Trivy)
- β Code quality checks
Just add this file to any repository:
# .github/workflows/pr-validation.yml (in any repo) name: PR Validation & Quality Checks on: pull_request: types: [opened, edited, reopened, synchronize] jobs: validate-and-label: uses: OpenResilienceInitiative/.github/.github/workflows/pr-validation.yml@main
That's it! All PR validation features work automatically.
Pull changes from the .github template repository into repositories created from it:
# .github/workflows/template-sync.yml (in any repo) name: Sync from Template Repository on: workflow_dispatch: inputs: create_pr: description: 'Create a PR instead of pushing directly' required: false default: true type: boolean schedule: # Run weekly on Monday at 2 AM UTC - cron: '0 2 * * 1' jobs: sync-template: uses: OpenResilienceInitiative/.github/.github/workflows/template-sync.yml@main with: template_repo: 'OpenResilienceInitiative/.github' template_branch: 'main' target_branch: 'main' create_pr: ${{ inputs.create_pr != false }}
Features:
- β Handles unrelated git histories (template repositories)
- β Automatic merge conflict resolution (template wins)
- β Optional PR creation for review
- β Sync specific paths only (optional)
- β Weekly automatic sync (optional)
π See: Template Sync Guide for detailed instructions.
1. Plan your workflow:
- What problem does it solve?
- Will it be used by multiple repositories?
- What triggers should it respond to?
2. Create the reusable workflow:
- File:
.github/.github/workflows/my-workflow.yml - Use
workflow_call:trigger - Set minimum required permissions
- Keep it simple and focused
3. Create the caller template:
- File:
.github/.github/workflows/my-workflow-caller.yml - Simple wrapper that calls your reusable workflow
- Deploy this to repositories
4. Document it:
- Add to this README
- Explain what it does
- Show example usage
5. Deploy it:
- Update
deploy-workflows.shif needed - Or deploy manually to specific repos
Labels are automatically applied via reusable workflows:
| Category | Labels | Auto-detection |
|---|---|---|
| Work Type | story, task, bug, hotfix |
Branch name |
| Priority | P0-Critical, P1-High, P2-Medium, P3-Low |
PR content |
| Area | frontend, backend, api, database, infra, docs |
Files changed |
| Size | S, M, L, XL |
File count |
- PR Template Guide - How to create proper PRs
- Issue Template Guide - How to use and customize issue templates
- Label Setup Guide - Understanding our label system
- Workflow Deployment Guide - How to deploy workflows
- Template Sync Guide - Sync changes from template repository
- Code Review Guide - Review standards
βββββββββββββββββββββββββββββββββββββββ
β .github Repository β
β (This repository - Source of Truth) β
β β
β ββββββββββββββββββββββββββββββββ β
β β Reusable Workflows β β
β β - pr-validation.yml β β
β β - create-labels.yml β β
β β - YOUR-NEW-WORKFLOW.yml β β
β ββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββ β
β β Caller Templates β β
β β (deployed to repos) β β
β ββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββ
β (automatic)
βββββββββββββββββββββββββββββββββββββββ
β All Organization Repositories β
β - ORISO-Frontend β
β - ORISO-Backend β
β - ORISO-Docs β
β - ... (16+ repositories) β
β β
β Each repo has caller workflows β
β that use reusable workflows β
βββββββββββββββββββββββββββββββββββββββ
Key Benefits:
- β Update once β All repos get updates automatically
- β No duplication β Single source of truth
- β Consistency β Same workflow behavior everywhere
- β Easy to add β New repos automatically get workflows
Open Resilience Initiative - Building accessible mental health support through open-source technology.
- Website: openresilience.cc
- Documentation: Platform Docs
- GitHub: @OpenResilienceInitiative