Files
moko-platform/docs/automation

MokoStandards

Automation Documentation

Documentation for all automation systems deployed across MokoStandards organization repositories.

Available Documentation

Automation Scripts

For details on available automation scripts, see:

CLI Tools (api/cli/)

Script Purpose
create_repo.php Scaffold new governed repo (7-step: create, topics, .mokostandards, README, labels, sync, project)
archive_repo.php Retire repo (close PRs/issues, archive on GitHub, remove sync def, create record)
create_project.php Provision GitHub Projects V2 from 10 platform templates
sync_rulesets.php Apply MAIN/VERSION/DEV rulesets to all repos via GitHub API
release.php Full release flow (bump, propagate, version branch, tag)
version_bump.php Bump version (major/minor/patch)
version_read.php Read current version from README
version_set_platform.php Set platform-specific version (Dolibarr/Joomla)
platform_detect.php Detect platform type from repo
release_notes.php Generate release notes from CHANGELOG

Validation (api/validate/)

Script Purpose
check_repo_health.php 118-point health score (9 categories incl. rulesets)
check_composer_deps.php Validate enterprise dependency version across all repos
scan_drift.php Detect file/config drift from standards

Maintenance (api/maintenance/)

Script Purpose
rotate_secrets.php Audit DEV/DEMO/RS FTP secrets and variables
repo_inventory.php Live inventory dashboard posted as GitHub issue
repo_cleanup.php 8 cleanup operations (branches, PRs, retired workflows, etc.)
update_version_from_readme.php Propagate version across all file headers and badges
setup_labels.php Deploy 58-label standard set

CI/CD Pipeline Overview

The complete automation pipeline runs on every push and pull request.

flowchart TD
    A[Code Push/PR] --> B[GitHub Actions Trigger]

    B --> C[Standards Compliance Check]
    B --> D[Security Scanning]
    B --> E[Code Quality Analysis]

    C --> C1[File Headers]
    C --> C2[Tabs/Spaces Policy]
    C --> C3[File Encoding]
    C --> C4[Trailing Spaces]
    C --> C5[CHANGELOG Format]

    D --> D1[Secret Scanning]
    D --> D2[CodeQL Analysis]
    D --> D3[Dependency Review]

    E --> E1[PHP Syntax Check]
    E --> E2[Shell Script Validation]
    E --> E4[Markdown Links]

    C1 --> F{All Checks Pass?}
    C2 --> F
    C3 --> F
    C4 --> F
    C5 --> F
    D1 --> F
    D2 --> F
    D3 --> F
    E1 --> F
    E2 --> F
    E4 --> F

    F -->|Yes| G[✓ Build Passes]
    F -->|No| H[✗ Build Fails]

    G --> I{Is Main Branch?}
    I -->|Yes| J[Trigger Auto-Release]
    I -->|No| K[Ready for Merge]

    style A fill:#e1f5ff
    style G fill:#c8e6c9
    style H fill:#ffccbc

Full diagram set: docs/visual/cicd-pipeline.md

Bulk Sync Workflow

bulk_sync.php synchronizes standards across all organization repositories with checkpoint recovery.

flowchart LR
    A[bulk_sync.php] --> B{--dry-run?}
    B -->|Yes| C[Simulate all operations\nNo API writes\nNo checkpoints written]
    B -->|No| D[Execute real sync\nWrite to GitHub API\nCheckpoint after each repo]

    style C fill:#fff9c4
    style D fill:#e1f5ff

Full diagram: docs/visual/bulk-sync-workflow.md

Scripts Documentation

Policy & Strategy

Support

For automation-related issues:

  1. Review script documentation in api/automation/
  2. Contact MokoStandards maintainers

Last Updated: 2026-02-26
Status: Production Ready