From e498b22b664c158f3288998f78968cbe08f05cc1 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 4 Jul 2026 14:22:20 -0500 Subject: [PATCH 1/2] ci: skip Joomla metadata check on template repos; fix sample script PHP - pr-metadata-check.yml: guard the validate-metadata job with !startsWith(github.event.repository.name, 'Template-'). Template repos have no real extension manifest, so the check cannot pass by design. - samples/script/*.php: give each installer script a valid class name (ComponentInstallerScript, ModuleInstallerScript, PluginInstallerScript, PackageInstallerScript) instead of the invalid `class {REPONAME}...` placeholder, so the files pass `php -l`. This matters for repos generated from this template that keep samples/. String/comment placeholders remain for find-replace. Authored-by: Moko Consulting --- .mokogitea/workflows/pr-metadata-check.yml | 2 ++ samples/script/script_component.php | 2 +- samples/script/script_module.php | 2 +- samples/script/script_package.php | 2 +- samples/script/script_plugin.php | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.mokogitea/workflows/pr-metadata-check.yml b/.mokogitea/workflows/pr-metadata-check.yml index b4c9cbd..5e2be9d 100644 --- a/.mokogitea/workflows/pr-metadata-check.yml +++ b/.mokogitea/workflows/pr-metadata-check.yml @@ -28,6 +28,8 @@ jobs: validate-metadata: name: "Validate Joomla Metadata" runs-on: ubuntu-latest + # Skip on template repos (Template-*) — they have no real extension manifest to validate. + if: ${{ !startsWith(github.event.repository.name, 'Template-') }} steps: - name: Checkout diff --git a/samples/script/script_component.php b/samples/script/script_component.php index d76930f..8a006d4 100644 --- a/samples/script/script_component.php +++ b/samples/script/script_component.php @@ -22,7 +22,7 @@ use Joomla\CMS\Log\Log; defined('_JEXEC') || die; -class {REPONAME}InstallerScript +class ComponentInstallerScript { /** * @var string The saved download key cached during preflight to survive updates diff --git a/samples/script/script_module.php b/samples/script/script_module.php index 19ccc0f..f9ace32 100644 --- a/samples/script/script_module.php +++ b/samples/script/script_module.php @@ -22,7 +22,7 @@ use Joomla\CMS\Log\Log; defined('_JEXEC') || die; -class {REPONAME}InstallerScript +class ModuleInstallerScript { /** * @var string The saved download key cached during preflight to survive updates diff --git a/samples/script/script_package.php b/samples/script/script_package.php index e1ea8e2..12afa1a 100644 --- a/samples/script/script_package.php +++ b/samples/script/script_package.php @@ -22,7 +22,7 @@ use Joomla\CMS\Log\Log; defined('_JEXEC') || die; -class {REPONAME}InstallerScript +class PackageInstallerScript { /** * @var string The saved download key cached during preflight to survive updates diff --git a/samples/script/script_plugin.php b/samples/script/script_plugin.php index e498a1f..a9c4ef5 100644 --- a/samples/script/script_plugin.php +++ b/samples/script/script_plugin.php @@ -22,7 +22,7 @@ use Joomla\CMS\Log\Log; defined('_JEXEC') || die; -class {REPONAME}InstallerScript +class PluginInstallerScript { /** * @var string The saved download key cached during preflight to survive updates -- 2.52.0 From 9927926295e20056edfeec3877f21f87ed18cc52 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 4 Jul 2026 14:29:41 -0500 Subject: [PATCH 2/2] ci: mirror template-repo CI guards from Template-Generic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sync doesn't auto-propagate Generic→template workflows (Phase 1 never auto-runs; Template-Generic has Actions disabled), so apply the same fixes from Template-Generic#48 directly: - ci-generic.yml (lint, test): skip on Template-* repos - pr-check.yml (validate): skip on Template-* repos - branch-cleanup.yml: drop PHP dependency for branch-name encoding Authored-by: Moko Consulting --- .mokogitea/workflows/branch-cleanup.yml | 3 ++- .mokogitea/workflows/ci-generic.yml | 4 ++++ .mokogitea/workflows/pr-check.yml | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.mokogitea/workflows/branch-cleanup.yml b/.mokogitea/workflows/branch-cleanup.yml index 9d884e7..dd5ff56 100644 --- a/.mokogitea/workflows/branch-cleanup.yml +++ b/.mokogitea/workflows/branch-cleanup.yml @@ -33,7 +33,8 @@ jobs: run: | BRANCH="${{ github.event.pull_request.head.ref }}" API="${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}/api/v1/repos/${{ github.repository }}/branches" - ENCODED=$(php -r "echo rawurlencode('${BRANCH}');") + # URL-encode the branch name's slashes (no PHP dependency on the runner) + ENCODED=$(printf '%s' "${BRANCH}" | sed 's|/|%2F|g') STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X DELETE \ -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \ diff --git a/.mokogitea/workflows/ci-generic.yml b/.mokogitea/workflows/ci-generic.yml index 92d2685..bb71ba4 100644 --- a/.mokogitea/workflows/ci-generic.yml +++ b/.mokogitea/workflows/ci-generic.yml @@ -32,6 +32,8 @@ jobs: lint: name: Lint & Validate runs-on: ubuntu-latest + # Skip on template repos (Template-*) — they hold placeholder scaffolding, not buildable source. + if: ${{ !startsWith(github.event.repository.name, 'Template-') }} steps: - name: Checkout @@ -130,6 +132,8 @@ jobs: name: Tests runs-on: ubuntu-latest needs: lint + # Skip on template repos (Template-*) — see lint job. + if: ${{ !startsWith(github.event.repository.name, 'Template-') }} steps: - name: Checkout diff --git a/.mokogitea/workflows/pr-check.yml b/.mokogitea/workflows/pr-check.yml index c834bf5..5c735a7 100644 --- a/.mokogitea/workflows/pr-check.yml +++ b/.mokogitea/workflows/pr-check.yml @@ -126,6 +126,8 @@ jobs: validate: name: Validate PR runs-on: ubuntu-latest + # Skip on template repos (Template-*) — no real manifest/source/changelog to validate. + if: ${{ !startsWith(github.event.repository.name, 'Template-') }} steps: - name: Checkout -- 2.52.0