@mokoconsulting/mcp-mokogitea-api 1.2.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.
- package/.gitattributes +94 -0
- package/.gitmessage +9 -0
- package/.mokogitea/ISSUE_TEMPLATE/adr.md +110 -0
- package/.mokogitea/ISSUE_TEMPLATE/bug_report.md +48 -0
- package/.mokogitea/ISSUE_TEMPLATE/config.yml +18 -0
- package/.mokogitea/ISSUE_TEMPLATE/documentation.md +52 -0
- package/.mokogitea/ISSUE_TEMPLATE/enterprise_support.md +85 -0
- package/.mokogitea/ISSUE_TEMPLATE/feature_request.md +51 -0
- package/.mokogitea/ISSUE_TEMPLATE/firewall-request.md +190 -0
- package/.mokogitea/ISSUE_TEMPLATE/mcp_api_integration.md +48 -0
- package/.mokogitea/ISSUE_TEMPLATE/mcp_connection_issue.md +67 -0
- package/.mokogitea/ISSUE_TEMPLATE/mcp_tool_request.md +49 -0
- package/.mokogitea/ISSUE_TEMPLATE/question.md +82 -0
- package/.mokogitea/ISSUE_TEMPLATE/rfc.md +126 -0
- package/.mokogitea/ISSUE_TEMPLATE/security.md +51 -0
- package/.mokogitea/ISSUE_TEMPLATE/version.md +24 -0
- package/.mokogitea/auto-assign.yml +76 -0
- package/.mokogitea/auto-dev-issue.yml +207 -0
- package/.mokogitea/auto-release.yml +337 -0
- package/.mokogitea/branch-protection.yml +251 -0
- package/.mokogitea/changelog-validation.yml +101 -0
- package/.mokogitea/codeql-analysis.yml +115 -0
- package/.mokogitea/copilot-agent.yml +44 -0
- package/.mokogitea/deploy-demo.yml +734 -0
- package/.mokogitea/deploy-dev.yml +700 -0
- package/.mokogitea/enterprise-firewall-setup.yml +758 -0
- package/.mokogitea/manifest.xml +25 -0
- package/.mokogitea/mcp-auto-release.yml +278 -0
- package/.mokogitea/mcp-build-test.yml +65 -0
- package/.mokogitea/mcp-sdk-check.yml +109 -0
- package/.mokogitea/mcp-tool-inventory.yml +61 -0
- package/.mokogitea/pr-branch-check.yml +90 -0
- package/.mokogitea/repository-cleanup.yml +525 -0
- package/.mokogitea/standards-compliance.yml +2614 -0
- package/.mokogitea/sync-version-on-merge.yml +133 -0
- package/.mokogitea/workflows/auto-assign.yml +76 -0
- package/.mokogitea/workflows/auto-bump.yml +66 -0
- package/.mokogitea/workflows/auto-dev-issue.yml +207 -0
- package/.mokogitea/workflows/auto-release.yml +341 -0
- package/.mokogitea/workflows/branch-cleanup.yml +48 -0
- package/.mokogitea/workflows/cascade-dev.yml +10 -0
- package/.mokogitea/workflows/changelog-validation.yml +101 -0
- package/.mokogitea/workflows/ci-generic.yml +204 -0
- package/.mokogitea/workflows/cleanup.yml +87 -0
- package/.mokogitea/workflows/codeql-analysis.yml +115 -0
- package/.mokogitea/workflows/copilot-agent.yml +44 -0
- package/.mokogitea/workflows/deploy-manual.yml +126 -0
- package/.mokogitea/workflows/enterprise-firewall-setup.yml +758 -0
- package/.mokogitea/workflows/gitleaks.yml +96 -0
- package/.mokogitea/workflows/issue-branch.yml +73 -0
- package/.mokogitea/workflows/mcp-auto-release.yml +280 -0
- package/.mokogitea/workflows/mcp-build-test.yml +65 -0
- package/.mokogitea/workflows/mcp-sdk-check.yml +109 -0
- package/.mokogitea/workflows/mcp-tool-inventory.yml +61 -0
- package/.mokogitea/workflows/notify.yml +70 -0
- package/.mokogitea/workflows/npm-publish.yml +51 -0
- package/.mokogitea/workflows/pr-check.yml +508 -0
- package/.mokogitea/workflows/pre-release.yml +11 -0
- package/.mokogitea/workflows/repo-health.yml +711 -0
- package/.mokogitea/workflows/repository-cleanup.yml +525 -0
- package/.mokogitea/workflows/security-audit.yml +82 -0
- package/.mokogitea/workflows/standards-compliance.yml +2614 -0
- package/.mokogitea/workflows/sync-version-on-merge.yml +130 -0
- package/.mokogitea/workflows/update-server.yml +312 -0
- package/CHANGELOG.md +145 -0
- package/CLAUDE.md +43 -0
- package/CONTRIBUTING.md +161 -0
- package/README.md +286 -0
- package/SECURITY.md +91 -0
- package/automation/ci-issue-reporter.sh +237 -0
- package/config.example.json +13 -0
- package/dist/client.d.ts +15 -0
- package/dist/client.js +104 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.js +48 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1119 -0
- package/dist/types.d.ts +20 -0
- package/dist/types.js +16 -0
- package/package.json +34 -0
- package/scripts/setup.mjs +40 -0
- package/src/client.ts +120 -0
- package/src/config.ts +58 -0
- package/src/index.ts +1712 -0
- package/src/types.ts +37 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,130 @@
|
|
|
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
|
|
9
|
+
# INGROUP: MokoStandards.Automation
|
|
10
|
+
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
|
11
|
+
# PATH: /templates/workflows/shared/sync-version-on-merge.yml.template
|
|
12
|
+
# VERSION: 04.06.00
|
|
13
|
+
# BRIEF: Auto-bump patch version on every push to main and propagate to all file headers
|
|
14
|
+
# NOTE: Synced via bulk-repo-sync to .mokogitea/workflows/sync-version-on-merge.yml in all governed repos.
|
|
15
|
+
# README.md is the single source of truth for the repository version.
|
|
16
|
+
|
|
17
|
+
name: "Universal: Sync Version on Merge"
|
|
18
|
+
|
|
19
|
+
on:
|
|
20
|
+
push:
|
|
21
|
+
branches:
|
|
22
|
+
- main
|
|
23
|
+
- master
|
|
24
|
+
workflow_dispatch:
|
|
25
|
+
inputs:
|
|
26
|
+
dry_run:
|
|
27
|
+
description: 'Dry run (preview only, no commit)'
|
|
28
|
+
type: boolean
|
|
29
|
+
default: false
|
|
30
|
+
|
|
31
|
+
permissions:
|
|
32
|
+
contents: write
|
|
33
|
+
issues: write
|
|
34
|
+
|
|
35
|
+
env:
|
|
36
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
sync-version:
|
|
40
|
+
name: Propagate README version
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
|
|
43
|
+
steps:
|
|
44
|
+
- name: Checkout repository
|
|
45
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
46
|
+
with:
|
|
47
|
+
token: ${{ secrets.GH_TOKEN || github.token }}
|
|
48
|
+
fetch-depth: 0
|
|
49
|
+
|
|
50
|
+
- name: Setup MokoStandards tools
|
|
51
|
+
run: |
|
|
52
|
+
# Use pre-installed mokoplatform on runner host (symlink /opt/mokoplatform -> /opt/moko-platform)
|
|
53
|
+
if [ -d /opt/mokoplatform/api/cli ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then
|
|
54
|
+
ln -sf /opt/mokoplatform /tmp/mokostandards
|
|
55
|
+
echo "Using pre-installed /opt/mokoplatform"
|
|
56
|
+
elif [ -d /opt/moko-platform/api/cli ]; then
|
|
57
|
+
ln -sf /opt/moko-platform /tmp/mokostandards
|
|
58
|
+
echo "Using pre-installed /opt/moko-platform"
|
|
59
|
+
else
|
|
60
|
+
echo "::warning::MokoStandards tools not found on runner - skipping"
|
|
61
|
+
echo "MOKO_SKIP=true" >> "$GITHUB_ENV"
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
- name: Auto-bump patch version
|
|
65
|
+
if: ${{ github.event_name == 'push' && github.actor != 'github-actions[bot]' }}
|
|
66
|
+
run: |
|
|
67
|
+
if git diff --name-only HEAD~1 HEAD 2>/dev/null | grep -q '^README\.md$'; then
|
|
68
|
+
echo "README.md changed in this push — skipping auto-bump"
|
|
69
|
+
exit 0
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
RESULT=$(php /tmp/mokostandards/api/cli/version_bump.php --path .) || {
|
|
73
|
+
echo "⚠️ Could not bump version — skipping"
|
|
74
|
+
exit 0
|
|
75
|
+
}
|
|
76
|
+
echo "Auto-bumping patch: $RESULT"
|
|
77
|
+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
78
|
+
git config --local user.name "github-actions[bot]"
|
|
79
|
+
git add README.md
|
|
80
|
+
git commit -m "chore(version): auto-bump patch ${RESULT} [skip ci]" \
|
|
81
|
+
--author="github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
|
|
82
|
+
git push
|
|
83
|
+
|
|
84
|
+
- name: Extract version from README.md
|
|
85
|
+
id: readme_version
|
|
86
|
+
run: |
|
|
87
|
+
git pull --ff-only 2>/dev/null || true
|
|
88
|
+
VERSION=$(php /tmp/mokostandards/api/cli/version_read.php --path . 2>/dev/null)
|
|
89
|
+
if [ -z "$VERSION" ]; then
|
|
90
|
+
echo "⚠️ No VERSION in README.md — skipping propagation"
|
|
91
|
+
echo "skip=true" >> $GITHUB_OUTPUT
|
|
92
|
+
exit 0
|
|
93
|
+
fi
|
|
94
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
95
|
+
echo "skip=false" >> $GITHUB_OUTPUT
|
|
96
|
+
echo "✅ README.md version: $VERSION"
|
|
97
|
+
|
|
98
|
+
- name: Run version sync
|
|
99
|
+
if: ${{ steps.readme_version.outputs.skip != 'true' && inputs.dry_run != true }}
|
|
100
|
+
run: |
|
|
101
|
+
php /tmp/mokostandards/api/maintenance/update_version_from_readme.php \
|
|
102
|
+
--path . \
|
|
103
|
+
--create-issue \
|
|
104
|
+
--repo "${{ github.repository }}"
|
|
105
|
+
env:
|
|
106
|
+
GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
|
|
107
|
+
|
|
108
|
+
- name: Commit updated files
|
|
109
|
+
if: ${{ steps.readme_version.outputs.skip != 'true' && inputs.dry_run != true }}
|
|
110
|
+
run: |
|
|
111
|
+
git pull --ff-only 2>/dev/null || true
|
|
112
|
+
if git diff --quiet; then
|
|
113
|
+
echo "ℹ️ No version changes needed — already up to date"
|
|
114
|
+
exit 0
|
|
115
|
+
fi
|
|
116
|
+
VERSION="${{ steps.readme_version.outputs.version }}"
|
|
117
|
+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
118
|
+
git config --local user.name "github-actions[bot]"
|
|
119
|
+
git add -A
|
|
120
|
+
git commit -m "chore(version): sync badges and headers to ${VERSION} [skip ci]" \
|
|
121
|
+
--author="github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
|
|
122
|
+
git push
|
|
123
|
+
|
|
124
|
+
- name: Summary
|
|
125
|
+
run: |
|
|
126
|
+
VERSION="${{ steps.readme_version.outputs.version }}"
|
|
127
|
+
echo "## 📦 Version Sync — ${VERSION}" >> $GITHUB_STEP_SUMMARY
|
|
128
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
129
|
+
echo "**Source:** \`README.md\` FILE INFORMATION block" >> $GITHUB_STEP_SUMMARY
|
|
130
|
+
echo "**Version:** \`${VERSION}\`" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,312 @@
|
|
|
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: Gitea.Workflow
|
|
7
|
+
# INGROUP: moko-platform.Universal
|
|
8
|
+
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
|
|
9
|
+
# PATH: /templates/workflows/update-server.yml
|
|
10
|
+
# VERSION: 05.00.00
|
|
11
|
+
# BRIEF: Pre-release build + update server XML for dev/alpha/beta/rc branches
|
|
12
|
+
#
|
|
13
|
+
# Thin wrapper around moko-platform CLI tools.
|
|
14
|
+
# Builds packages, updates updates.xml, and optionally deploys via SFTP.
|
|
15
|
+
#
|
|
16
|
+
# Joomla filters update entries by the user's "Minimum Stability" setting.
|
|
17
|
+
|
|
18
|
+
name: "Update Server"
|
|
19
|
+
|
|
20
|
+
on:
|
|
21
|
+
push:
|
|
22
|
+
branches:
|
|
23
|
+
- 'dev'
|
|
24
|
+
- 'dev/**'
|
|
25
|
+
- 'alpha/**'
|
|
26
|
+
- 'beta/**'
|
|
27
|
+
- 'rc/**'
|
|
28
|
+
paths:
|
|
29
|
+
- 'src/**'
|
|
30
|
+
- 'htdocs/**'
|
|
31
|
+
pull_request:
|
|
32
|
+
types: [closed]
|
|
33
|
+
branches:
|
|
34
|
+
- 'dev'
|
|
35
|
+
- 'dev/**'
|
|
36
|
+
- 'alpha/**'
|
|
37
|
+
- 'beta/**'
|
|
38
|
+
- 'rc/**'
|
|
39
|
+
paths:
|
|
40
|
+
- 'src/**'
|
|
41
|
+
- 'htdocs/**'
|
|
42
|
+
workflow_dispatch:
|
|
43
|
+
inputs:
|
|
44
|
+
stability:
|
|
45
|
+
description: 'Stability tag'
|
|
46
|
+
required: true
|
|
47
|
+
default: 'development'
|
|
48
|
+
type: choice
|
|
49
|
+
options:
|
|
50
|
+
- development
|
|
51
|
+
- alpha
|
|
52
|
+
- beta
|
|
53
|
+
- rc
|
|
54
|
+
- stable
|
|
55
|
+
|
|
56
|
+
env:
|
|
57
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
58
|
+
GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }}
|
|
59
|
+
GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }}
|
|
60
|
+
GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }}
|
|
61
|
+
|
|
62
|
+
permissions:
|
|
63
|
+
contents: write
|
|
64
|
+
|
|
65
|
+
jobs:
|
|
66
|
+
update-xml:
|
|
67
|
+
name: Update Server
|
|
68
|
+
runs-on: release
|
|
69
|
+
if: >-
|
|
70
|
+
github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
|
|
71
|
+
|
|
72
|
+
steps:
|
|
73
|
+
- name: Checkout repository
|
|
74
|
+
uses: actions/checkout@v4
|
|
75
|
+
with:
|
|
76
|
+
token: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
77
|
+
fetch-depth: 0
|
|
78
|
+
|
|
79
|
+
- name: Setup moko-platform tools
|
|
80
|
+
env:
|
|
81
|
+
MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }}
|
|
82
|
+
MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting
|
|
83
|
+
COMPOSER_AUTH: '{"http-basic":{"git.mokoconsulting.tech":{"username":"token","password":"${{ secrets.MOKOGITEA_TOKEN }}"}}}'
|
|
84
|
+
run: |
|
|
85
|
+
if ! command -v composer &> /dev/null; then
|
|
86
|
+
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1
|
|
87
|
+
fi
|
|
88
|
+
# Always fetch latest CLI tools — never use stale cache from previous runs
|
|
89
|
+
rm -rf /tmp/moko-platform
|
|
90
|
+
git clone --depth 1 --branch main --quiet \
|
|
91
|
+
"https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git" \
|
|
92
|
+
/tmp/moko-platform 2>/dev/null || true
|
|
93
|
+
if [ -d "/tmp/moko-platform" ] && [ -f "/tmp/moko-platform/composer.json" ]; then
|
|
94
|
+
cd /tmp/moko-platform && composer install --no-dev --no-interaction --quiet 2>/dev/null || true
|
|
95
|
+
fi
|
|
96
|
+
echo "MOKO_CLI=/tmp/moko-platform/cli" >> "$GITHUB_ENV"
|
|
97
|
+
|
|
98
|
+
- name: Detect platform
|
|
99
|
+
id: platform
|
|
100
|
+
run: php ${MOKO_CLI}/manifest_read.php --path . --github-output
|
|
101
|
+
|
|
102
|
+
- name: Resolve stability and bump version
|
|
103
|
+
id: meta
|
|
104
|
+
run: |
|
|
105
|
+
BRANCH="${{ github.ref_name }}"
|
|
106
|
+
|
|
107
|
+
# Configure git for bot pushes
|
|
108
|
+
git config --local user.email "gitea-actions[bot]@mokoconsulting.tech"
|
|
109
|
+
git config --local user.name "gitea-actions[bot]"
|
|
110
|
+
git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git"
|
|
111
|
+
|
|
112
|
+
# Auto-bump patch version
|
|
113
|
+
php ${MOKO_CLI}/version_bump.php --path . 2>/dev/null || true
|
|
114
|
+
|
|
115
|
+
VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null || echo "0.0.0")
|
|
116
|
+
|
|
117
|
+
# Strip any existing suffix before applying stability
|
|
118
|
+
VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//')
|
|
119
|
+
|
|
120
|
+
# Determine stability from branch or manual input
|
|
121
|
+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
122
|
+
STABILITY="${{ inputs.stability }}"
|
|
123
|
+
elif [[ "$BRANCH" == rc/* ]]; then
|
|
124
|
+
STABILITY="rc"
|
|
125
|
+
elif [[ "$BRANCH" == beta/* ]]; then
|
|
126
|
+
STABILITY="beta"
|
|
127
|
+
elif [[ "$BRANCH" == alpha/* ]]; then
|
|
128
|
+
STABILITY="alpha"
|
|
129
|
+
else
|
|
130
|
+
STABILITY="development"
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# Version suffix per stability stream
|
|
134
|
+
case "$STABILITY" in
|
|
135
|
+
development) SUFFIX="-dev"; TAG="development" ;;
|
|
136
|
+
alpha) SUFFIX="-alpha"; TAG="alpha" ;;
|
|
137
|
+
beta) SUFFIX="-beta"; TAG="beta" ;;
|
|
138
|
+
rc) SUFFIX="-rc"; TAG="release-candidate" ;;
|
|
139
|
+
*) SUFFIX=""; TAG="stable" ;;
|
|
140
|
+
esac
|
|
141
|
+
|
|
142
|
+
# Propagate version with stability suffix to all manifest files
|
|
143
|
+
php ${MOKO_CLI}/version_set_platform.php \
|
|
144
|
+
--path . --version "$VERSION" --branch "$BRANCH" --stability "$STABILITY" 2>/dev/null || true
|
|
145
|
+
php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true
|
|
146
|
+
|
|
147
|
+
# Re-read version (now includes suffix from version_set_platform)
|
|
148
|
+
if [ -n "$SUFFIX" ]; then
|
|
149
|
+
VERSION="${VERSION}${SUFFIX}"
|
|
150
|
+
fi
|
|
151
|
+
|
|
152
|
+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
153
|
+
echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT"
|
|
154
|
+
echo "suffix=${SUFFIX}" >> "$GITHUB_OUTPUT"
|
|
155
|
+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
|
156
|
+
echo "display_version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
157
|
+
|
|
158
|
+
# Commit version bump if changed
|
|
159
|
+
git add -A
|
|
160
|
+
git diff --cached --quiet || {
|
|
161
|
+
git commit -m "chore(version): auto-bump ${VERSION} [skip ci]" \
|
|
162
|
+
--author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
|
|
163
|
+
git push
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
- name: Create release and upload package
|
|
167
|
+
id: package
|
|
168
|
+
run: |
|
|
169
|
+
VERSION="${{ steps.meta.outputs.version }}"
|
|
170
|
+
TAG="${{ steps.meta.outputs.tag }}"
|
|
171
|
+
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
172
|
+
|
|
173
|
+
# Create or update Gitea release
|
|
174
|
+
php ${MOKO_CLI}/release_create.php \
|
|
175
|
+
--path . --version "$VERSION" --tag "$TAG" \
|
|
176
|
+
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
|
177
|
+
--repo "${GITEA_REPO}" --branch "${{ github.ref_name }}" --prerelease
|
|
178
|
+
|
|
179
|
+
# Build package and upload
|
|
180
|
+
php ${MOKO_CLI}/release_package.php \
|
|
181
|
+
--path . --version "$VERSION" --tag "$TAG" \
|
|
182
|
+
--token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \
|
|
183
|
+
--repo "${GITEA_REPO}" --output /tmp || true
|
|
184
|
+
|
|
185
|
+
- name: Update updates.xml
|
|
186
|
+
if: steps.platform.outputs.platform == 'joomla'
|
|
187
|
+
run: |
|
|
188
|
+
VERSION="${{ steps.meta.outputs.version }}"
|
|
189
|
+
STABILITY="${{ steps.meta.outputs.stability }}"
|
|
190
|
+
SHA256="${{ steps.package.outputs.sha256_zip }}"
|
|
191
|
+
|
|
192
|
+
if [ ! -f "updates.xml" ]; then
|
|
193
|
+
echo "No updates.xml — skipping"
|
|
194
|
+
exit 0
|
|
195
|
+
fi
|
|
196
|
+
|
|
197
|
+
SHA_FLAG=""
|
|
198
|
+
[ -n "$SHA256" ] && SHA_FLAG="--sha ${SHA256}"
|
|
199
|
+
|
|
200
|
+
php ${MOKO_CLI}/updates_xml_build.php \
|
|
201
|
+
--path . --version "${VERSION}" --stability "${STABILITY}" \
|
|
202
|
+
--gitea-url "${GITEA_URL}" --org "${GITEA_ORG}" --repo "${GITEA_REPO}" \
|
|
203
|
+
${SHA_FLAG}
|
|
204
|
+
|
|
205
|
+
# Commit and push updates.xml
|
|
206
|
+
git add updates.xml
|
|
207
|
+
git diff --cached --quiet || {
|
|
208
|
+
git commit -m "chore: update ${STABILITY} channel ${VERSION} [skip ci]"
|
|
209
|
+
git push
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
- name: Sync updates.xml to main
|
|
213
|
+
if: github.ref_name != 'main' && steps.platform.outputs.platform == 'joomla'
|
|
214
|
+
run: |
|
|
215
|
+
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
216
|
+
GITEA_TOKEN="${{ secrets.MOKOGITEA_TOKEN }}"
|
|
217
|
+
|
|
218
|
+
FILE_SHA=$(curl -sf -H "Authorization: token ${GITEA_TOKEN}" \
|
|
219
|
+
"${API_BASE}/contents/updates.xml?ref=main" | python3 -c "import sys,json; print(json.load(sys.stdin).get('sha',''))" 2>/dev/null || true)
|
|
220
|
+
|
|
221
|
+
if [ -n "$FILE_SHA" ] && [ -f "updates.xml" ]; then
|
|
222
|
+
python3 -c "
|
|
223
|
+
import base64, json, urllib.request, sys
|
|
224
|
+
with open('updates.xml', 'rb') as f:
|
|
225
|
+
content = base64.b64encode(f.read()).decode()
|
|
226
|
+
payload = json.dumps({
|
|
227
|
+
'content': content,
|
|
228
|
+
'sha': '${FILE_SHA}',
|
|
229
|
+
'message': 'chore: sync updates.xml from ${{ steps.meta.outputs.stability }} [skip ci]',
|
|
230
|
+
'branch': 'main'
|
|
231
|
+
}).encode()
|
|
232
|
+
req = urllib.request.Request(
|
|
233
|
+
'${API_BASE}/contents/updates.xml',
|
|
234
|
+
data=payload, method='PUT',
|
|
235
|
+
headers={
|
|
236
|
+
'Authorization': 'token ${GITEA_TOKEN}',
|
|
237
|
+
'Content-Type': 'application/json'
|
|
238
|
+
})
|
|
239
|
+
try:
|
|
240
|
+
urllib.request.urlopen(req)
|
|
241
|
+
print('updates.xml synced to main')
|
|
242
|
+
except Exception as e:
|
|
243
|
+
print(f'WARNING: sync to main failed: {e}', file=sys.stderr)
|
|
244
|
+
"
|
|
245
|
+
fi
|
|
246
|
+
|
|
247
|
+
- name: SFTP deploy to dev server
|
|
248
|
+
if: contains(github.ref, 'dev/') || github.ref == 'refs/heads/dev'
|
|
249
|
+
env:
|
|
250
|
+
DEV_HOST: ${{ vars.DEV_FTP_HOST }}
|
|
251
|
+
DEV_PATH: ${{ vars.DEV_FTP_PATH }}
|
|
252
|
+
DEV_SUFFIX: ${{ vars.DEV_FTP_SUFFIX }}
|
|
253
|
+
DEV_USER: ${{ vars.DEV_FTP_USERNAME }}
|
|
254
|
+
DEV_PORT: ${{ vars.DEV_FTP_PORT }}
|
|
255
|
+
DEV_KEY: ${{ secrets.DEV_FTP_KEY }}
|
|
256
|
+
DEV_PASS: ${{ secrets.DEV_FTP_PASSWORD }}
|
|
257
|
+
run: |
|
|
258
|
+
# Permission check: admin or maintain role required
|
|
259
|
+
ACTOR="${{ github.actor }}"
|
|
260
|
+
API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}"
|
|
261
|
+
|
|
262
|
+
PERMISSION=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \
|
|
263
|
+
"${API_BASE}/collaborators/${ACTOR}/permission" 2>/dev/null | \
|
|
264
|
+
python3 -c "import sys,json; print(json.load(sys.stdin).get('permission','read'))" 2>/dev/null || echo "read")
|
|
265
|
+
case "$PERMISSION" in
|
|
266
|
+
admin|maintain|write) ;;
|
|
267
|
+
*)
|
|
268
|
+
echo "Deploy denied: ${ACTOR} has '${PERMISSION}' — requires admin, maintain, or write"
|
|
269
|
+
exit 0
|
|
270
|
+
;;
|
|
271
|
+
esac
|
|
272
|
+
|
|
273
|
+
[ -z "$DEV_HOST" ] || [ -z "$DEV_PATH" ] && { echo "DEV FTP not configured — skipping SFTP"; exit 0; }
|
|
274
|
+
|
|
275
|
+
SOURCE_DIR="src"
|
|
276
|
+
[ ! -d "$SOURCE_DIR" ] && SOURCE_DIR="htdocs"
|
|
277
|
+
[ ! -d "$SOURCE_DIR" ] && exit 0
|
|
278
|
+
|
|
279
|
+
PORT="${DEV_PORT:-22}"
|
|
280
|
+
REMOTE="${DEV_PATH%/}"
|
|
281
|
+
[ -n "$DEV_SUFFIX" ] && REMOTE="${REMOTE}/${DEV_SUFFIX#/}"
|
|
282
|
+
|
|
283
|
+
printf '{"host":"%s","port":%s,"username":"%s","remotePath":"%s"' \
|
|
284
|
+
"$DEV_HOST" "$PORT" "$DEV_USER" "$REMOTE" > /tmp/sftp-config.json
|
|
285
|
+
if [ -n "$DEV_KEY" ]; then
|
|
286
|
+
echo "$DEV_KEY" > /tmp/deploy_key && chmod 600 /tmp/deploy_key
|
|
287
|
+
printf ',"privateKeyPath":"/tmp/deploy_key"}' >> /tmp/sftp-config.json
|
|
288
|
+
else
|
|
289
|
+
printf ',"password":"%s"}' "$DEV_PASS" >> /tmp/sftp-config.json
|
|
290
|
+
fi
|
|
291
|
+
|
|
292
|
+
PLATFORM=$(php ${MOKO_CLI}/platform_detect.php --path . 2>/dev/null || true)
|
|
293
|
+
if [ "$PLATFORM" = "waas-component" ] && [ -f "${MOKO_CLI}/../deploy/deploy-joomla.php" ]; then
|
|
294
|
+
php ${MOKO_CLI}/../deploy/deploy-joomla.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
|
295
|
+
elif [ -f "${MOKO_CLI}/../deploy/deploy-sftp.php" ]; then
|
|
296
|
+
php ${MOKO_CLI}/../deploy/deploy-sftp.php --path . --src-dir "$SOURCE_DIR" --config /tmp/sftp-config.json
|
|
297
|
+
fi
|
|
298
|
+
rm -f /tmp/deploy_key /tmp/sftp-config.json
|
|
299
|
+
echo "SFTP deploy to dev complete" >> $GITHUB_STEP_SUMMARY
|
|
300
|
+
|
|
301
|
+
- name: Summary
|
|
302
|
+
if: always()
|
|
303
|
+
run: |
|
|
304
|
+
VERSION="${{ steps.meta.outputs.version }}"
|
|
305
|
+
STABILITY="${{ steps.meta.outputs.stability }}"
|
|
306
|
+
DISPLAY="${{ steps.meta.outputs.display_version }}"
|
|
307
|
+
echo "## Update Server" >> $GITHUB_STEP_SUMMARY
|
|
308
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
309
|
+
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
|
|
310
|
+
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
|
|
311
|
+
echo "| Stability | \`${STABILITY}\` |" >> $GITHUB_STEP_SUMMARY
|
|
312
|
+
echo "| Version | \`${DISPLAY}\` |" >> $GITHUB_STEP_SUMMARY
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<!-- Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
2
|
+
SPDX-License-Identifier: GPL-3.0-or-later
|
|
3
|
+
DEFGROUP: gitea-api-mcp.Documentation
|
|
4
|
+
REPO: https://git.mokoconsulting.tech/MokoConsulting/gitea-api-mcp
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
# Changelog
|
|
8
|
+
|
|
9
|
+
All notable changes to this project will be documented in this file.
|
|
10
|
+
|
|
11
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
12
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
13
|
+
|
|
14
|
+
## [Unreleased]
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- `gitea_org_issue_statuses_list` -- list issue status definitions for an org
|
|
18
|
+
- `gitea_org_issue_priorities_list` -- list issue priority definitions for an org
|
|
19
|
+
- `gitea_org_issue_types_list` -- list issue type definitions for an org
|
|
20
|
+
- `gitea_issue_set_status` -- set/clear status on an issue (convenience wrapper)
|
|
21
|
+
- `gitea_issue_set_priority` -- set/clear priority on an issue (convenience wrapper)
|
|
22
|
+
- `gitea_issue_create` now accepts `status_id`, `priority_id`, `type_id` params
|
|
23
|
+
- `gitea_issue_update` now accepts `status_id`, `priority_id`, `type_id` params
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Migrated all workflow and template paths from `.github/` to `.mokogitea/`
|
|
27
|
+
- Template source paths updated: `templates/gitea/` to `templates/mokogitea/`
|
|
28
|
+
- HCL definition files removed -- Template repos are now the canonical source
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- `branch-cleanup.yml`: auto-delete merged feature branches after PR merge
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- **Renamed** package from `@mokoconsulting/gitea-api-mcp` to `@mokoconsulting/mokogitea-api-mcp` to distinguish Moko's forked Gitea MCP from upstream
|
|
35
|
+
- **Renamed** McpServer name and bin entry to `mokogitea-api-mcp`
|
|
36
|
+
|
|
37
|
+
## [0.0.1] - 2026-05-07
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
#### User / Auth (3 tools)
|
|
42
|
+
- `gitea_me` -- Get the authenticated user info
|
|
43
|
+
- `gitea_user_orgs` -- List organizations the authenticated user belongs to
|
|
44
|
+
- `gitea_user_repos` -- List repositories owned by the authenticated user
|
|
45
|
+
|
|
46
|
+
#### Repositories (8 tools)
|
|
47
|
+
- `gitea_repo_get` -- Get repository details
|
|
48
|
+
- `gitea_repo_create` -- Create a new repository
|
|
49
|
+
- `gitea_repo_delete` -- Delete a repository
|
|
50
|
+
- `gitea_repo_edit` -- Edit repository settings
|
|
51
|
+
- `gitea_repo_fork` -- Fork a repository
|
|
52
|
+
- `gitea_repo_search` -- Search repositories
|
|
53
|
+
- `gitea_org_repos` -- List repositories in an organization
|
|
54
|
+
- `gitea_list_connections` -- List configured Gitea connections
|
|
55
|
+
|
|
56
|
+
#### File Contents (5 tools)
|
|
57
|
+
- `gitea_file_get` -- Get file contents from a repository
|
|
58
|
+
- `gitea_dir_get` -- Get directory contents (file listing) from a repository
|
|
59
|
+
- `gitea_file_create_or_update` -- Create or update a file in a repository
|
|
60
|
+
- `gitea_file_delete` -- Delete a file from a repository
|
|
61
|
+
- `gitea_tree_get` -- Get the git tree for a repository (recursive file listing)
|
|
62
|
+
|
|
63
|
+
#### Branches (4 tools)
|
|
64
|
+
- `gitea_branches_list` -- List branches in a repository
|
|
65
|
+
- `gitea_branch_get` -- Get a specific branch
|
|
66
|
+
- `gitea_branch_create` -- Create a new branch
|
|
67
|
+
- `gitea_branch_delete` -- Delete a branch
|
|
68
|
+
|
|
69
|
+
#### Commits (2 tools)
|
|
70
|
+
- `gitea_commits_list` -- List commits in a repository
|
|
71
|
+
- `gitea_commit_get` -- Get a specific commit
|
|
72
|
+
|
|
73
|
+
#### Issues (7 tools)
|
|
74
|
+
- `gitea_issues_list` -- List issues in a repository
|
|
75
|
+
- `gitea_issue_get` -- Get a single issue by number
|
|
76
|
+
- `gitea_issue_create` -- Create a new issue
|
|
77
|
+
- `gitea_issue_update` -- Update an issue
|
|
78
|
+
- `gitea_issue_comments_list` -- List comments on an issue
|
|
79
|
+
- `gitea_issue_comment_create` -- Add a comment to an issue
|
|
80
|
+
- `gitea_issue_search` -- Search issues across all repositories
|
|
81
|
+
|
|
82
|
+
#### Labels (2 tools)
|
|
83
|
+
- `gitea_labels_list` -- List labels in a repository
|
|
84
|
+
- `gitea_label_create` -- Create a label
|
|
85
|
+
|
|
86
|
+
#### Milestones (2 tools)
|
|
87
|
+
- `gitea_milestones_list` -- List milestones in a repository
|
|
88
|
+
- `gitea_milestone_create` -- Create a milestone
|
|
89
|
+
|
|
90
|
+
#### Pull Requests (6 tools)
|
|
91
|
+
- `gitea_pulls_list` -- List pull requests
|
|
92
|
+
- `gitea_pull_get` -- Get a single pull request
|
|
93
|
+
- `gitea_pull_create` -- Create a pull request
|
|
94
|
+
- `gitea_pull_merge` -- Merge a pull request
|
|
95
|
+
- `gitea_pull_files` -- List files changed in a pull request
|
|
96
|
+
- `gitea_pull_review_create` -- Create a pull request review
|
|
97
|
+
|
|
98
|
+
#### Releases (5 tools)
|
|
99
|
+
- `gitea_releases_list` -- List releases
|
|
100
|
+
- `gitea_release_get` -- Get a single release by ID
|
|
101
|
+
- `gitea_release_latest` -- Get the latest release
|
|
102
|
+
- `gitea_release_create` -- Create a new release
|
|
103
|
+
- `gitea_release_delete` -- Delete a release
|
|
104
|
+
|
|
105
|
+
#### Tags (3 tools)
|
|
106
|
+
- `gitea_tags_list` -- List tags
|
|
107
|
+
- `gitea_tag_create` -- Create a tag
|
|
108
|
+
- `gitea_tag_delete` -- Delete a tag
|
|
109
|
+
|
|
110
|
+
#### Actions (2 tools)
|
|
111
|
+
- `gitea_actions_runs_list` -- List workflow runs for a repository
|
|
112
|
+
- `gitea_actions_run_get` -- Get a specific workflow run
|
|
113
|
+
|
|
114
|
+
#### Organizations (3 tools)
|
|
115
|
+
- `gitea_org_get` -- Get organization details
|
|
116
|
+
- `gitea_org_teams_list` -- List teams in an organization
|
|
117
|
+
- `gitea_org_members_list` -- List members of an organization
|
|
118
|
+
|
|
119
|
+
#### Users (2 tools)
|
|
120
|
+
- `gitea_user_get` -- Get a user profile
|
|
121
|
+
- `gitea_users_search` -- Search users
|
|
122
|
+
|
|
123
|
+
#### Webhooks (2 tools)
|
|
124
|
+
- `gitea_webhooks_list` -- List webhooks for a repository
|
|
125
|
+
- `gitea_webhook_create` -- Create a webhook
|
|
126
|
+
|
|
127
|
+
#### Wiki (2 tools)
|
|
128
|
+
- `gitea_wiki_pages_list` -- List wiki pages
|
|
129
|
+
- `gitea_wiki_page_get` -- Get a wiki page
|
|
130
|
+
|
|
131
|
+
#### Notifications (2 tools)
|
|
132
|
+
- `gitea_notifications_list` -- List notifications for the authenticated user
|
|
133
|
+
- `gitea_notifications_read` -- Mark all notifications as read
|
|
134
|
+
|
|
135
|
+
#### Generic (2 tools)
|
|
136
|
+
- `gitea_api_request` -- Make a raw API request to any Gitea v1 endpoint
|
|
137
|
+
- `gitea_list_connections` -- List configured Gitea connections
|
|
138
|
+
|
|
139
|
+
### Infrastructure
|
|
140
|
+
- Multi-connection config support via `~/.gitea-api-mcp.json`
|
|
141
|
+
- Token-based authentication (Gitea native `Authorization: token` header)
|
|
142
|
+
- Built on `node:https` / `node:http` (zero HTTP dependencies)
|
|
143
|
+
- MCP SDK v1.12.x with stdio transport
|
|
144
|
+
|
|
145
|
+
[0.0.1]: https://git.mokoconsulting.tech/MokoConsulting/gitea-api-mcp/releases/tag/v0.0.1
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code when working with this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
**gitea-api-mcp** -- MCP server for Gitea REST API v1 operations — 61 tools for repos, issues, PRs, releases, branches, actions, orgs, wiki, webhooks, and more
|
|
8
|
+
|
|
9
|
+
| Field | Value |
|
|
10
|
+
|---|---|
|
|
11
|
+
| **Platform** | mcp-server |
|
|
12
|
+
| **Language** | TypeScript |
|
|
13
|
+
| **Default branch** | main |
|
|
14
|
+
| **License** | GPL-3.0-or-later |
|
|
15
|
+
| **Wiki** | [gitea-api-mcp Wiki](https://git.mokoconsulting.tech/MokoConsulting/gitea-api-mcp/wiki) |
|
|
16
|
+
| **Standards** | [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home) |
|
|
17
|
+
|
|
18
|
+
## Common Commands
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install # Install dependencies
|
|
22
|
+
npm run build # Compile TypeScript
|
|
23
|
+
npm run dev # Development mode
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Architecture
|
|
27
|
+
|
|
28
|
+
This is an MCP (Model Context Protocol) server. Key files:
|
|
29
|
+
- `src/index.ts` -- server entry point and tool registration
|
|
30
|
+
- `src/config.ts` -- configuration loading
|
|
31
|
+
- `src/tools/` -- individual tool implementations
|
|
32
|
+
- `dist/` -- compiled output (gitignored)
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
- **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`)
|
|
37
|
+
|
|
38
|
+
- **Never commit** `.claude/`, `.mcp.json`, `TODO.md`, or `*.min.css`/`*.min.js`
|
|
39
|
+
- **Attribution**: use `Authored-by: Moko Consulting` in commits
|
|
40
|
+
- **Branch strategy**: develop on `dev`, merge to `main` for release
|
|
41
|
+
- **Minification**: handled at build time (CI) and runtime (MokoMinifyHelper for Joomla templates)
|
|
42
|
+
- **Wiki**: documentation lives in the Gitea wiki, not in `docs/` files
|
|
43
|
+
- **Standards**: this repo follows [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home)
|