Delete .github/workflows/create-client-fork.yml
Signed-off-by: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
152
.github/workflows/create-client-fork.yml
vendored
152
.github/workflows/create-client-fork.yml
vendored
@@ -1,152 +0,0 @@
|
||||
---
|
||||
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
# GitHub Actions Workflow: Create Client Fork Implementation
|
||||
|
||||
name: Create Client Fork
|
||||
|
||||
"on":
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
client_name:
|
||||
description: 'Client Name (e.g., "Acme Corporation")'
|
||||
required: true
|
||||
type: string
|
||||
confirm:
|
||||
description: 'Type "CONFIRM" to proceed'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
create-fork:
|
||||
name: Setup Client Fork
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Validate confirmation
|
||||
if: ${{ inputs.confirm != 'CONFIRM' }}
|
||||
run: |
|
||||
echo "::error::Type CONFIRM to proceed"
|
||||
exit 1
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup Git
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Create client fork branch
|
||||
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}"
|
||||
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
|
||||
echo "CLIENT_SLUG=${CLIENT_SLUG}" >> $GITHUB_ENV
|
||||
|
||||
- name: Copy custom color templates
|
||||
run: |
|
||||
echo "Copying colors_custom.css..."
|
||||
cp templates/colors_custom.css src/media/css/colors/light/colors_custom.css
|
||||
cp templates/colors_custom.css src/media/css/colors/dark/colors_custom.css
|
||||
|
||||
if [ -f "src/media/css/colors/light/colors_custom.css" ]; then
|
||||
echo "✓ Created light mode colors_custom.css"
|
||||
else
|
||||
echo "::error::Failed to create light mode colors_custom.css"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "src/media/css/colors/dark/colors_custom.css" ]; then
|
||||
echo "✓ Created dark mode colors_custom.css"
|
||||
else
|
||||
echo "::error::Failed to create dark mode colors_custom.css"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Replace README with client fork README
|
||||
run: |
|
||||
echo "Replacing README.md..."
|
||||
sed "s/\[CLIENT NAME\]/${{ inputs.client_name }}/g" CLIENT_FORK_README.md > README.md
|
||||
|
||||
CURRENT_DATE=$(date +"%Y-%m-%d")
|
||||
sed -i "s/\[DATE\]/${CURRENT_DATE}/g" README.md
|
||||
sed -i "s/\[YOUR-FORK-URL\]/https:\/\/github.com\/${GITHUB_REPOSITORY}/g" README.md
|
||||
|
||||
echo "✓ README.md replaced"
|
||||
|
||||
- name: Clean up template files
|
||||
run: |
|
||||
echo "Removing template files..."
|
||||
|
||||
if [ -f "CLIENT_FORK_README.md" ]; then
|
||||
rm CLIENT_FORK_README.md
|
||||
echo "✓ Removed CLIENT_FORK_README.md"
|
||||
fi
|
||||
|
||||
if [ -f "templates/CLIENT_FORK_README_TEMPLATE.md" ]; then
|
||||
rm templates/CLIENT_FORK_README_TEMPLATE.md
|
||||
echo "✓ Removed templates/CLIENT_FORK_README_TEMPLATE.md"
|
||||
fi
|
||||
|
||||
if [ -f "templates/README.md" ]; then
|
||||
sed -i '/CLIENT_FORK_README_TEMPLATE.md/d' templates/README.md
|
||||
sed -i '/Client Fork README Template/,/^---$/d' templates/README.md
|
||||
echo "✓ Updated templates/README.md"
|
||||
fi
|
||||
|
||||
echo "✓ Keeping templates/colors_custom.css"
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git add .
|
||||
git status
|
||||
|
||||
if git diff --staged --quiet; then
|
||||
echo "No changes to commit"
|
||||
else
|
||||
git commit -m "Setup client fork for ${{ inputs.client_name }}" \
|
||||
-m "Copied colors_custom.css to src/media/css/colors/" \
|
||||
-m "Replaced README.md with CLIENT_FORK_README.md" \
|
||||
-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"
|
||||
fi
|
||||
|
||||
- name: Push branch
|
||||
run: |
|
||||
git push origin "${BRANCH_NAME}"
|
||||
echo "✓ Branch ${BRANCH_NAME} pushed"
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
cat >> $GITHUB_STEP_SUMMARY << EOF
|
||||
## Client Fork Setup Complete! 🎉
|
||||
|
||||
### Changes Applied
|
||||
- ✓ Copied colors_custom.css to src/media/css/colors/
|
||||
- ✓ Replaced README.md
|
||||
- ✓ Removed CLIENT_FORK_README.md
|
||||
- ✓ Removed templates/CLIENT_FORK_README_TEMPLATE.md
|
||||
- ✓ Kept templates/colors_custom.css
|
||||
|
||||
### Next Steps
|
||||
1. Review branch: \`${BRANCH_NAME}\`
|
||||
2. Customize colors in src/media/css/colors/
|
||||
3. Update README.md with client details
|
||||
4. Create new repository for ${{ inputs.client_name }}
|
||||
5. Push branch to new repository
|
||||
|
||||
### Branch Information
|
||||
- **Branch**: \`${BRANCH_NAME}\`
|
||||
- **Client**: ${{ inputs.client_name }}
|
||||
EOF
|
||||
Reference in New Issue
Block a user