Add automated client fork creation workflow #79
Merged
Copilot
merged 7 commits from 2026-02-20 02:00:06 +00:00
copilot/create-readme-template into main
Labels
Clear labels
automation
breaking-change
bug
build
ci-cd
config
css
dependencies
deploy-failure
docker
documentation
dolibarr
duplicate
enhancement
generic
good first issue
health-check
health: excellent
health: fair
health: good
health: poor
help wanted
html
invalid
javascript
joomla
major-release
minor-release
mokostandards
needs-changelog
needs-review
needs-testing
patch-release
php
priority: critical
priority: high
priority: low
priority: medium
push-failure
python
question
regression
release
release-candidate
security
size/l
size/m
size/s
size/xl
size/xs
size/xxl
standards-drift
standards-update
standards-violation
status: blocked
status: in-progress
status: on-hold
status: pending
status: wontfix
sync-failure
sync-report
template-validation-failure
test-failure
tests
type: bug
type: chore
type: enhancement
type: feature
type: refactor
type: release
type: test
type: version
typescript
version
version-branch
version-drift
version-update
wontfix
work-in-progress
bug
chore
documentation
enhancement
feature
priority: critical
priority: high
priority: low
priority: medium
refactor
scope: client
scope: dolibarr
scope: infrastructure
scope: joomla
scope: waas
security
status: blocked
status: duplicate
status: in-progress
status: needs-review
status: wontfix
Automated processes or scripts
Breaking API or functionality change
Something isn't working
Build system changes
CI/CD pipeline changes
Configuration file changes
CSS/styling changes
Dependency updates
Automated deploy failure tracking
Docker configuration changes
Documentation changes
Dolibarr module or extension
This issue or pull request already exists
New feature or request
Generic project or library
Good for newcomers
Repository health check results
Health score 90-100
Health score 50-69
Health score 70-89
Health score below 50
Extra attention is needed
HTML template changes
This doesn't seem right
JavaScript code changes
Joomla extension or component
Major version release (breaking changes)
Minor version release (XX.YY.00)
MokoStandards compliance
Awaiting code review
Requires manual or automated testing
Patch version release (XX.YY.ZZ)
PHP code changes
Critical priority, must be addressed immediately
High priority
Low priority
Medium priority
File push failure requiring attention
Python code changes
Further information is requested
Regression from a previous working state
Release related PR
Release candidate build
Security-related changes
Large change (101-300 lines)
Medium change (31-100 lines)
Small change (11-30 lines)
Extra large change (301-1000 lines)
Extra small change (1-10 lines)
Extremely large change (1000+ lines)
Repository drifted from MokoStandards
MokoStandards sync update
Standards compliance failure
Blocked by another issue or dependency
Currently being worked on
Temporarily on hold
Pending action or decision
This will not be worked on
Bulk sync failure requiring attention
Bulk sync run report
Template workflow validation failure
Automated test failure
Test suite changes
Something isn't working
Maintenance tasks
Enhancement to existing feature
New feature or request
Code refactoring
Release preparation or tracking
Test suite additions or changes
Version-related change
TypeScript code changes
Version bump or release
Version branch related
Version mismatch detected
Version bump and release PR
This will not be worked on
Work in progress, not ready for merge
Something is not working
Maintenance and housekeeping
Documentation improvements
Improvement to existing functionality
New feature or request
Must fix immediately
Should fix soon
Nice to have
Fix when convenient
Code restructuring without behavior change
Client-specific work
Dolibarr modules and customizations
Server, CI, backups, monitoring
Joomla templates and extensions
MokoWaaS platform
Security vulnerability or hardening
Waiting on external dependency
Duplicate of another issue
Being worked on
Ready for review
Will not be addressed
No Label
Milestone
No items
No Milestone
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: MokoConsulting/MokoCassiopeia#79
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "copilot/create-readme-template"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull Request
Purpose
Automate client fork setup: copy custom color templates, replace documentation, create properly-named branch. Reduces manual 20-minute process to 2-minute workflow execution.
Change Summary
Automation (2 methods)
GitHub Actions workflow (
.github/workflows/create-client-fork.yml)client-fork/{client-slug}contents: write(minimal)Local bash script (
scripts/create-client-fork.sh)Operations
templates/colors_custom.css→src/media/css/colors/{light,dark}/colors_custom.cssREADME.mdwith customizedCLIENT_FORK_README.md(client name, date)CLIENT_FORK_README.mdandtemplates/CLIENT_FORK_README_TEMPLATE.mdtemplates/colors_custom.css(reference template)Documentation
docs/CLIENT_FORK_WORKFLOW.md: Complete usage guide for both methodsREADME.md,docs/README.md,CLIENT_FORK_README.mdTesting Evidence
Risk and Rollback
Risk: None. Additive changes only—no modification to existing fork workflows.
Rollback: Delete
.github/workflows/create-client-fork.yml,scripts/create-client-fork.sh,docs/CLIENT_FORK_WORKFLOW.md. Revert documentation updates.Checklist
Reviewer Notes
Workflow requires "CONFIRM" input—prevents accidental execution.
Branch naming convention:
client-fork/{lowercase-hyphenated-name}(e.g.,client-fork/acme-corporation).Post-workflow: Users customize colors in newly-created
colors_custom.cssfiles, then push branch to new client repository.Review and Approval
Standard review process applies.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
@@ -0,0 +1,152 @@---Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
Show more details
@@ -0,0 +1,152 @@---Workflow does not contain permissions
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}
Show more details
Pull request overview
Adds an automated “client fork setup” capability to the MokoCassiopeia repo (GitHub Actions + local script), along with templates and documentation to standardize how client-specific forks are created and documented.
Changes:
client-fork/{client-slug}branch and apply fork setup steps automatically.Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.
Show a summary per file
.github/workflows/create-client-fork.ymlscripts/create-client-fork.shdocs/CLIENT_FORK_WORKFLOW.mddocs/README.mdREADME.mdCLIENT_FORK_README.mdtemplates/README.md/templatesand how to use the templates.templates/CLIENT_FORK_README_TEMPLATE.md💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@@ -0,0 +46,4 @@- name: Create client fork branchrun: |CLIENT_NAME="${{ inputs.client_name }}"CLIENT_SLUG=$(echo "${CLIENT_NAME}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')CLIENT_SLUGis derived only by lowercasing and replacing spaces. Client names containing characters like/,&,., or multiple whitespace can produce invalid git branch names (and could also lead to awkward paths in automation output). Consider sanitizing to[a-z0-9-], collapsing runs of-, and trimming leading/trailing dashes before formingBRANCH_NAME.@@ -0,0 +47,4 @@run: |CLIENT_NAME="${{ inputs.client_name }}"CLIENT_SLUG=$(echo "${CLIENT_NAME}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')BRANCH_NAME="client-fork/${CLIENT_SLUG}"git checkout -b "${BRANCH_NAME}"will fail if the branch already exists (e.g., reruns for the same client). Consider adding an explicit existence check and emitting a clear::error::message (or switching togit checkout -Bif overwriting is acceptable) so the failure mode is predictable.@@ -0,0 +80,4 @@CURRENT_DATE=$(date +"%Y-%m-%d")sed -i "s/\[DATE\]/${CURRENT_DATE}/g" README.mdsed -i "s/\[YOUR-FORK-URL\]/https:\/\/github.com\/${GITHUB_REPOSITORY}/g" README.mdThe sed replacement uses the raw
inputs.client_nameas the replacement string. If the client name contains characters meaningful to sed replacements (e.g.,&,/, or backslashes), README generation can break or produce incorrect output. Escape the replacement string before substituting, or use a tool/approach that safely handles arbitrary text.@@ -0,0 +99,4 @@if [ -f "templates/README.md" ]; thensed -i '/CLIENT_FORK_README_TEMPLATE.md/d' templates/README.mdsed -i '/Client Fork README Template/,/^---$/d' templates/README.mdThe workflow removes
CLIENT_FORK_README.mdbut thetemplates/README.mdedits only remove the client fork template section.templates/README.mdstill contains links/instructions pointing to../CLIENT_FORK_README.md, which will be broken after deletion. Update the cleanup step to remove or rewrite all references to files that are deleted in the fork branch.@@ -0,0 +119,4 @@-m "Removed CLIENT_FORK_README.md" \-m "Removed templates/CLIENT_FORK_README_TEMPLATE.md" \-m "Kept templates/colors_custom.css as template"echo "✓ Changes committed"The custom color files you copy into src/media/css/colors/*/colors_custom.css are ignored by .gitignore, so
git add .will not stage them and the fork branch won’t actually contain the generated color files. Force-add just those files (e.g., explicitgit add -f <paths>), or adjust the workflow to temporarily override the ignore rules before committing.@@ -0,0 +32,4 @@fiCLIENT_NAME="$1"CLIENT_SLUG=$(echo "${CLIENT_NAME}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')CLIENT_SLUGonly lowercases and replaces spaces, so client names with punctuation or characters like/can generate invalid git branch names. Sanitize the slug to an allowlist (e.g.,[a-z0-9-]), collapse repeated-, and trim leading/trailing dashes before creatingBRANCH_NAME.@@ -0,0 +61,4 @@# Create new branchprint_info "Creating branch: ${BRANCH_NAME}"git checkout -b "${BRANCH_NAME}"print_success "Branch created"The script creates a new branch immediately, but it doesn’t verify the working tree is clean first. If the user has unrelated local changes, they may be unintentionally carried into the client fork branch/commit. Consider failing early when
git status --porcelainis non-empty (and/or stage only the specific expected files rather thangit add .).@@ -0,0 +79,4 @@# Replace README with client fork READMEprint_info "Replacing README.md with CLIENT_FORK_README.md..."sed "s/\[CLIENT NAME\]/${CLIENT_NAME}/g" CLIENT_FORK_README.md > README.md.newmv README.md.new README.mdThe sed replacement uses
${CLIENT_NAME}unescaped as the replacement string. Names containing&,/, or backslashes can break the substitution or yield incorrect README content. Escape the replacement string (and ideally use a delimiter that avoids common characters) before running sed.@@ -0,0 +113,4 @@rm -f templates/README.md.bakprint_success "Updated templates/README.md"fiThis update to
templates/README.mdonly deletes lines containingCLIENT_FORK_README_TEMPLATE.md, which will leave an incomplete/broken section (headings and instructions remain but the referenced file is deleted). Match the workflow behavior by removing the entire client-fork template section and any other references to files you delete during setup.@@ -0,0 +135,4 @@- Removed CLIENT_FORK_README.md and templates/CLIENT_FORK_README_TEMPLATE.md- Kept templates/colors_custom.css as templateThis commit prepares the repository for ${CLIENT_NAME}'s custom fork."The custom color files copied into
src/media/css/colors/{light,dark}/colors_custom.cssare ignored by this repo’s.gitignore, sogit add .will not stage them. If the goal is for client forks to track these files, force-add those specific paths (or modify ignore rules as part of the fork setup) before committing.