@mokoconsulting/mcp-mokosuite 1.1.0-dev.372 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,117 +0,0 @@
1
- # Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
2
- #
3
- # This file is part of a Moko Consulting project.
4
- #
5
- # SPDX-License-Identifier: GPL-3.0-or-later
6
- #
7
- # FILE INFORMATION
8
- # DEFGROUP: GitHub.Workflow.Template
9
- # INGROUP: MokoStandards.CI
10
- # REPO: https://github.com/mokoconsulting-tech/MokoStandards
11
- # PATH: /templates/workflows/shared/changelog-validation.yml.template
12
- # VERSION: 04.06.01
13
- # BRIEF: Validates CHANGELOG.md format and version consistency
14
- # NOTE: Deployed to .mokogit/workflows/changelog-validation.yml in governed repos.
15
-
16
- name: "Universal: Changelog Validation"
17
-
18
- on:
19
- push:
20
- branches:
21
- - main
22
- pull_request:
23
- branches:
24
- - main
25
- workflow_dispatch:
26
-
27
- permissions:
28
- contents: read
29
-
30
- env:
31
- FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
32
-
33
- concurrency:
34
- # storm-reduction: collapse superseded validation runs on the same ref
35
- group: ${{ github.workflow }}-${{ github.ref }}
36
- cancel-in-progress: true
37
-
38
- jobs:
39
- validate-changelog:
40
- name: Validate CHANGELOG.md
41
- runs-on: ubuntu-latest
42
-
43
- steps:
44
- - name: Checkout repository
45
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
46
-
47
- - name: Check CHANGELOG.md exists
48
- run: |
49
- echo "### Changelog Validation" | tee -a $GITHUB_STEP_SUMMARY
50
- if [ ! -f "CHANGELOG.md" ]; then
51
- echo "CHANGELOG.md not found in repository root." | tee -a $GITHUB_STEP_SUMMARY
52
- exit 1
53
- fi
54
- echo "CHANGELOG.md exists." | tee -a $GITHUB_STEP_SUMMARY
55
-
56
- - name: Check VERSION header matches README.md (only if README declares one)
57
- run: |
58
- # A FILE INFORMATION VERSION block is optional in README.md — public-facing
59
- # READMEs typically have none. Only enforce a CHANGELOG match when README
60
- # actually declares a version; otherwise skip (not a failure).
61
- # `|| true`: under the default `bash -e -o pipefail`, a grep with no match
62
- # exits 1 and pipefail propagates it, which would abort the step BEFORE the
63
- # `-z` skip below — the exact common case (README with no VERSION block). Keep
64
- # the empty result non-fatal so the intended skip path stays reachable.
65
- README_VERSION=$(grep -oP '^\s*VERSION:\s*\K[0-9]+\.[0-9]+\.[0-9]+' README.md 2>/dev/null | head -1 || true)
66
- if [ -z "$README_VERSION" ]; then
67
- echo "README.md has no FILE INFORMATION VERSION block — skipping version-match check." | tee -a $GITHUB_STEP_SUMMARY
68
- exit 0
69
- fi
70
-
71
- CHANGELOG_VERSION=$(grep -oP '^\#\#\s*\[\K[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md | head -1 || true)
72
- if [ -z "$CHANGELOG_VERSION" ]; then
73
- echo "README declares VERSION \`${README_VERSION}\` but CHANGELOG.md has no matching \`## [X.Y.Z]\` header." | tee -a $GITHUB_STEP_SUMMARY
74
- exit 1
75
- fi
76
-
77
- if [ "$CHANGELOG_VERSION" != "$README_VERSION" ]; then
78
- echo "CHANGELOG latest version \`${CHANGELOG_VERSION}\` does not match README VERSION \`${README_VERSION}\`." | tee -a $GITHUB_STEP_SUMMARY
79
- exit 1
80
- fi
81
-
82
- echo "CHANGELOG version \`${CHANGELOG_VERSION}\` matches README VERSION." | tee -a $GITHUB_STEP_SUMMARY
83
-
84
- - name: Validate conventional changelog format
85
- run: |
86
- ERRORS=0
87
-
88
- # Validate the format of each version entry. `## [Unreleased]` is a valid
89
- # Keep-a-Changelog section (not a dated version) and is skipped.
90
- while IFS= read -r LINE; do
91
- if echo "$LINE" | grep -qiE '^\#\#[[:space:]]*\[unreleased\]'; then
92
- continue
93
- fi
94
- if ! echo "$LINE" | grep -qP '^\#\#\s*\[[0-9]+\.[0-9]+\.[0-9]+\]\s*[-–—]+\s*[0-9]{4}-[0-9]{2}-[0-9]{2}'; then
95
- echo "Malformed version header: \`${LINE}\`" | tee -a $GITHUB_STEP_SUMMARY
96
- echo " Expected format: \`## [X.Y.Z] --- YYYY-MM-DD\` (any hyphen/dash separator)" | tee -a $GITHUB_STEP_SUMMARY
97
- ERRORS=$((ERRORS + 1))
98
- fi
99
- done < <(grep -P '^\#\#\s*\[' CHANGELOG.md)
100
-
101
- # Count real (dated) version entries, excluding the Unreleased section.
102
- VERSION_COUNT=$(grep -P '^\#\#\s*\[' CHANGELOG.md | { grep -viE '\[unreleased\]' || true; } | wc -l | tr -d ' ')
103
- HAS_UNRELEASED=$(grep -ciE '^\#\#[[:space:]]*\[unreleased\]' CHANGELOG.md | tr -d ' ')
104
- if [ "$VERSION_COUNT" -eq 0 ] && [ "$HAS_UNRELEASED" -eq 0 ]; then
105
- echo "No version entries or Unreleased section found in CHANGELOG.md." | tee -a $GITHUB_STEP_SUMMARY
106
- ERRORS=$((ERRORS + 1))
107
- else
108
- echo "Found ${VERSION_COUNT} released version entr(ies)$([ "$HAS_UNRELEASED" -gt 0 ] && echo ' + an Unreleased section') in CHANGELOG.md." | tee -a $GITHUB_STEP_SUMMARY
109
- fi
110
-
111
- echo "" | tee -a $GITHUB_STEP_SUMMARY
112
- if [ "${ERRORS}" -gt 0 ]; then
113
- echo "**${ERRORS} format issue(s) found.**" | tee -a $GITHUB_STEP_SUMMARY
114
- exit 1
115
- else
116
- echo "**Changelog format validation passed.**" | tee -a $GITHUB_STEP_SUMMARY
117
- fi
@@ -1,83 +0,0 @@
1
- # Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
2
- #
3
- # SPDX-License-Identifier: GPL-3.0-or-later
4
- #
5
- # FILE INFORMATION
6
- # DEFGROUP: MokoGIT.Workflow
7
- # INGROUP: MokoCLI.Universal
8
- # REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
9
- # PATH: /.mokogit/workflows/workflow-sync-trigger.yml
10
- # VERSION: 01.01.01
11
- # BRIEF: Trigger workflow sync to live repos when a PR is merged to main
12
-
13
- name: "Universal: Workflow Sync Trigger"
14
-
15
- on:
16
- workflow_dispatch:
17
- pull_request:
18
- types: [closed]
19
- branches:
20
- - main
21
-
22
- env:
23
- FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
24
-
25
- jobs:
26
- sync:
27
- name: Sync workflows to live repos
28
- runs-on: release
29
- if: >-
30
- startsWith(github.event.repository.name, 'Template-') &&
31
- (github.event_name == 'workflow_dispatch' ||
32
- (github.event.pull_request.merged == true &&
33
- !contains(github.event.pull_request.title, '[skip sync]')))
34
-
35
- steps:
36
- - name: Determine platform from repo name
37
- id: platform
38
- run: |
39
- REPO="${{ github.event.repository.name }}"
40
- case "$REPO" in
41
- Template-Joomla) PLATFORM="joomla" ;;
42
- Template-Dolibarr) PLATFORM="dolibarr" ;;
43
- Template-Go) PLATFORM="go" ;;
44
- Template-NPM) PLATFORM="npm" ;;
45
- Template-Generic) PLATFORM="" ;;
46
- *) PLATFORM="" ;;
47
- esac
48
- echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
49
- echo "Platform: ${PLATFORM:-all}"
50
-
51
- - name: Clone MokoCLI
52
- env:
53
- MOKOGIT_TOKEN: ${{ secrets.MOKOGIT_TOKEN }}
54
- run: |
55
- MOKOGIT_URL="${{ vars.MOKOGIT_URL || 'https://git.mokoconsulting.tech' }}"
56
- git clone --depth 1 "${MOKOGIT_URL}/MokoConsulting/mokocli.git" /tmp/mokocli
57
-
58
- - name: Install PHP
59
- run: |
60
- if ! command -v php &> /dev/null; then
61
- apt-get update -qq && apt-get install -y -qq php-cli php-json php-curl > /dev/null 2>&1
62
- fi
63
-
64
- - name: Install dependencies
65
- run: |
66
- cd /tmp/mokocli
67
- composer install --no-dev --no-interaction --quiet 2>/dev/null || true
68
-
69
- - name: Run workflow sync
70
- env:
71
- MOKOGIT_TOKEN: ${{ secrets.MOKOGIT_TOKEN }}
72
- run: |
73
- ARGS="--token ${MOKOGIT_TOKEN}"
74
- ARGS="${ARGS} --org ${{ vars.MOKOGIT_ORG || github.repository_owner }}"
75
- ARGS="${ARGS} --phase repos"
76
- ARGS="${ARGS} --delete-orphans"
77
-
78
- PLATFORM="${{ steps.platform.outputs.platform }}"
79
- if [ -n "$PLATFORM" ]; then
80
- ARGS="${ARGS} --platform-filter ${PLATFORM}"
81
- fi
82
-
83
- php /tmp/mokocli/cli/workflow_sync.php ${ARGS}
@@ -1,94 +0,0 @@
1
- # Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
2
- #
3
- # SPDX-License-Identifier: GPL-3.0-or-later
4
- #
5
- # FILE INFORMATION
6
- # DEFGROUP: MokoGIT.Workflow
7
- # INGROUP: MokoCLI.Security
8
- # REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
9
- # PATH: /.mokogit/workflows/gitleaks.yml
10
- # VERSION: 01.00.00
11
- # BRIEF: Secret scanning — detect leaked credentials, API keys, and tokens
12
- #
13
- # +========================================================================+
14
- # | SECRET SCANNING |
15
- # +========================================================================+
16
- # | |
17
- # | Scans commits for leaked secrets using Gitleaks. |
18
- # | |
19
- # | - PR scan: only new commits in the PR |
20
- # | - Scheduled: full repo scan weekly |
21
- # | - Alerts via ntfy on findings |
22
- # | |
23
- # +========================================================================+
24
-
25
- name: "Universal: Secret Scanning"
26
-
27
- on:
28
- schedule:
29
- - cron: '0 5 * * 1' # Weekly Monday 05:00 UTC
30
- workflow_dispatch:
31
-
32
- permissions:
33
- contents: read
34
-
35
- env:
36
- NTFY_URL: ${{ vars.NTFY_URL || 'https://ntfy.mokoconsulting.tech' }}
37
- NTFY_TOPIC: ${{ vars.NTFY_TOPIC || 'mokogit-security' }}
38
- NTFY_TOKEN: ${{ secrets.NTFY_TOKEN }}
39
-
40
- jobs:
41
- gitleaks:
42
- name: Gitleaks Secret Scan
43
- runs-on: ubuntu-latest
44
-
45
- steps:
46
- - name: Checkout
47
- uses: actions/checkout@v4
48
- with:
49
- fetch-depth: 0
50
-
51
- - name: Install Gitleaks
52
- run: |
53
- GITLEAKS_VERSION="8.21.2"
54
- curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
55
- | tar -xz -C /usr/local/bin gitleaks
56
- gitleaks version
57
-
58
- - name: Scan for secrets
59
- id: scan
60
- run: |
61
- echo "### Secret Scanning" >> $GITHUB_STEP_SUMMARY
62
- ARGS="--source . --verbose --report-format json --report-path /tmp/gitleaks-report.json"
63
-
64
- if [ "${{ github.event_name }}" = "pull_request" ]; then
65
- # Scan only PR commits
66
- ARGS="$ARGS --log-opts=${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
67
- echo "Scanning PR commits only" >> $GITHUB_STEP_SUMMARY
68
- else
69
- echo "Full repository scan" >> $GITHUB_STEP_SUMMARY
70
- fi
71
-
72
- if gitleaks detect $ARGS 2>&1; then
73
- echo "result=clean" >> "$GITHUB_OUTPUT"
74
- echo "**No secrets detected.**" >> $GITHUB_STEP_SUMMARY
75
- else
76
- echo "result=found" >> "$GITHUB_OUTPUT"
77
- FINDINGS=$(jq length /tmp/gitleaks-report.json 2>/dev/null || echo "unknown")
78
- echo "**${FINDINGS} potential secret(s) detected.**" >> $GITHUB_STEP_SUMMARY
79
- echo "" >> $GITHUB_STEP_SUMMARY
80
- echo "Review the findings and rotate any exposed credentials immediately." >> $GITHUB_STEP_SUMMARY
81
- exit 1
82
- fi
83
-
84
- - name: Notify on findings
85
- if: failure() && steps.scan.outputs.result == 'found'
86
- run: |
87
- REPO="${{ github.event.repository.name }}"
88
- curl -sS \
89
- -H "Title: ${REPO} — secrets detected in code" \
90
- -H "Tags: rotating_light,key" \
91
- -H "Priority: urgent" \
92
- -d "Gitleaks found potential secrets. Review and rotate credentials immediately." \
93
- -H "Authorization: Bearer ${NTFY_TOKEN}" \
94
- "${NTFY_URL}/${NTFY_TOPIC}" || true
@@ -1,73 +0,0 @@
1
- # Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
2
- #
3
- # SPDX-License-Identifier: GPL-3.0-or-later
4
- #
5
- # FILE INFORMATION
6
- # DEFGROUP: MokoGIT.Workflow
7
- # INGROUP: MokoCLI.Notifications
8
- # REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
9
- # PATH: /.mokogit/workflows/notify.yml
10
- # VERSION: 01.00.00
11
- # BRIEF: Push notifications via ntfy on release success or workflow failure
12
-
13
- name: "Universal: Notifications"
14
-
15
- on:
16
- workflow_run:
17
- workflows:
18
- - "Universal: Build & Release"
19
- - "Joomla: Extension CI"
20
- - "Generic: Project CI"
21
- types:
22
- - completed
23
-
24
- permissions:
25
- contents: read
26
-
27
- env:
28
- NTFY_URL: ${{ vars.NTFY_URL || 'https://ntfy.mokoconsulting.tech' }}
29
- NTFY_TOPIC: ${{ vars.NTFY_TOPIC || 'mokogit-releases' }}
30
- NTFY_TOKEN: ${{ secrets.NTFY_TOKEN }}
31
-
32
- jobs:
33
- notify:
34
- name: Send Notification
35
- runs-on: ubuntu-latest
36
- if: >-
37
- github.event.workflow_run.conclusion == 'success' ||
38
- github.event.workflow_run.conclusion == 'failure'
39
-
40
- steps:
41
- - name: Notify on success (releases only)
42
- if: >-
43
- github.event.workflow_run.conclusion == 'success' &&
44
- contains(github.event.workflow_run.name, 'Release')
45
- run: |
46
- REPO="${{ github.event.repository.name }}"
47
- WORKFLOW="${{ github.event.workflow_run.name }}"
48
- URL="${{ github.event.workflow_run.html_url }}"
49
-
50
- curl -sS --retry 3 --retry-connrefused --retry-delay 2 --max-time 20 \
51
- -H "Title: ${REPO} released" \
52
- -H "Tags: white_check_mark,package" \
53
- -H "Priority: default" \
54
- -H "Click: ${URL}" \
55
- -d "${WORKFLOW} completed successfully." \
56
- -H "Authorization: Bearer ${NTFY_TOKEN}" \
57
- "${NTFY_URL}/${NTFY_TOPIC}" || echo "::warning::ntfy notification could not be delivered (non-fatal)"
58
-
59
- - name: Notify on failure
60
- if: github.event.workflow_run.conclusion == 'failure'
61
- run: |
62
- REPO="${{ github.event.repository.name }}"
63
- WORKFLOW="${{ github.event.workflow_run.name }}"
64
- URL="${{ github.event.workflow_run.html_url }}"
65
-
66
- curl -sS --retry 3 --retry-connrefused --retry-delay 2 --max-time 20 \
67
- -H "Title: ${REPO} workflow failed" \
68
- -H "Tags: x,warning" \
69
- -H "Priority: high" \
70
- -H "Click: ${URL}" \
71
- -d "${WORKFLOW} failed. Check the run for details." \
72
- -H "Authorization: Bearer ${NTFY_TOKEN}" \
73
- "${NTFY_URL}/${NTFY_TOPIC}" || echo "::warning::ntfy notification could not be delivered (non-fatal)"