@mokoconsulting/mokoabs-mcp 0.0.0-stage → 4.0.2
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/.editorconfig +41 -0
- package/.gitattributes +94 -0
- package/.gitmessage +9 -0
- package/.mokogit/ISSUE_TEMPLATE/adr.md +110 -0
- package/.mokogit/ISSUE_TEMPLATE/bug_report.md +48 -0
- package/.mokogit/ISSUE_TEMPLATE/config.yml +18 -0
- package/.mokogit/ISSUE_TEMPLATE/documentation.md +52 -0
- package/.mokogit/ISSUE_TEMPLATE/feature_request.md +51 -0
- package/.mokogit/ISSUE_TEMPLATE/mcp_api_integration.md +48 -0
- package/.mokogit/ISSUE_TEMPLATE/mcp_connection_issue.md +69 -0
- package/.mokogit/ISSUE_TEMPLATE/mcp_tool_request.md +50 -0
- package/.mokogit/ISSUE_TEMPLATE/question.md +82 -0
- package/.mokogit/ISSUE_TEMPLATE/rfc.md +126 -0
- package/.mokogit/ISSUE_TEMPLATE/security.md +51 -0
- package/.mokogit/ISSUE_TEMPLATE/version.md +24 -0
- package/.mokogit/actions/resolve-source-dir/action.yml +72 -0
- package/.mokogit/workflows/apidocs.yml +132 -0
- package/.mokogit/workflows/auto-assign.yml +76 -0
- package/.mokogit/workflows/auto-dev-issue.yml +207 -0
- package/.mokogit/workflows/auto-release.yml +1787 -0
- package/.mokogit/workflows/branch-cleanup.yml +63 -0
- package/.mokogit/workflows/cascade.yml +645 -0
- package/.mokogit/workflows/ci-issue-reporter.yml +100 -0
- package/.mokogit/workflows/cleanup.yml +112 -0
- package/.mokogit/workflows/makefile-lint.yml +240 -0
- package/.mokogit/workflows/npm-build-test.yml +507 -0
- package/.mokogit/workflows/npm-sdk-check.yml +110 -0
- package/.mokogit/workflows/npm-tool-inventory.yml +81 -0
- package/.mokogit/workflows/pr-branch-check.yml +92 -0
- package/.mokogit/workflows/pre-release.yml +1134 -0
- package/.mokogit/workflows/rc-revert.yml +75 -0
- package/AGENTS.md +48 -0
- package/CHANGELOG.md +37 -0
- package/CODE_OF_CONDUCT.md +70 -0
- package/CONTRIBUTING.md +164 -0
- package/LICENSE +696 -0
- package/Makefile +94 -0
- package/README.md +109 -2
- package/SECURITY.md +245 -0
- package/build/README.md +7 -0
- package/dist/README.md +7 -0
- package/dist/index.js +153 -0
- package/package.json +34 -5
- package/sample/config.example.json +15 -0
- package/source/client.ts +132 -0
- package/source/config.ts +139 -0
- package/source/credentialStore.ts +216 -0
- package/source/index.ts +235 -0
- package/source/tokenReader.ts +120 -0
- package/source/types.ts +63 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Request for Comments (RFC)
|
|
3
|
+
about: Propose a significant change for community discussion
|
|
4
|
+
title: '[RFC] '
|
|
5
|
+
labels: 'rfc, discussion'
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## RFC Summary
|
|
12
|
+
One-paragraph summary of the proposal.
|
|
13
|
+
|
|
14
|
+
## Motivation
|
|
15
|
+
Why are we doing this? What use cases does it support? What is the expected outcome?
|
|
16
|
+
|
|
17
|
+
## Detailed Design
|
|
18
|
+
### Overview
|
|
19
|
+
Provide a detailed explanation of the proposed change.
|
|
20
|
+
|
|
21
|
+
### API Changes (if applicable)
|
|
22
|
+
```php
|
|
23
|
+
// Before
|
|
24
|
+
function oldApi($param1) { }
|
|
25
|
+
|
|
26
|
+
// After
|
|
27
|
+
function newApi($param1, $param2) { }
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### User Experience Changes
|
|
31
|
+
Describe how users will interact with this change.
|
|
32
|
+
|
|
33
|
+
### Implementation Approach
|
|
34
|
+
High-level implementation strategy.
|
|
35
|
+
|
|
36
|
+
## Drawbacks
|
|
37
|
+
Why should we *not* do this?
|
|
38
|
+
|
|
39
|
+
## Alternatives
|
|
40
|
+
What other designs have been considered? What is the impact of not doing this?
|
|
41
|
+
|
|
42
|
+
### Alternative 1
|
|
43
|
+
- Description
|
|
44
|
+
- Trade-offs
|
|
45
|
+
|
|
46
|
+
### Alternative 2
|
|
47
|
+
- Description
|
|
48
|
+
- Trade-offs
|
|
49
|
+
|
|
50
|
+
## Adoption Strategy
|
|
51
|
+
How will existing users adopt this? Is this a breaking change?
|
|
52
|
+
|
|
53
|
+
### Migration Guide
|
|
54
|
+
```bash
|
|
55
|
+
# Steps to migrate
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Deprecation Timeline
|
|
59
|
+
- **Announcement**:
|
|
60
|
+
- **Deprecation**:
|
|
61
|
+
- **Removal**:
|
|
62
|
+
|
|
63
|
+
## Unresolved Questions
|
|
64
|
+
- Question 1
|
|
65
|
+
- Question 2
|
|
66
|
+
|
|
67
|
+
## Future Possibilities
|
|
68
|
+
What future work does this enable?
|
|
69
|
+
|
|
70
|
+
## Impact Assessment
|
|
71
|
+
### Performance
|
|
72
|
+
Expected performance impact.
|
|
73
|
+
|
|
74
|
+
### Security
|
|
75
|
+
Security considerations and implications.
|
|
76
|
+
|
|
77
|
+
### Compatibility
|
|
78
|
+
- **Backward Compatible**: [Yes / No]
|
|
79
|
+
- **Breaking Changes**: [List]
|
|
80
|
+
|
|
81
|
+
### Maintenance
|
|
82
|
+
Long-term maintenance considerations.
|
|
83
|
+
|
|
84
|
+
## Community Input
|
|
85
|
+
### Stakeholders
|
|
86
|
+
- [ ] Core team
|
|
87
|
+
- [ ] Module developers
|
|
88
|
+
- [ ] End users
|
|
89
|
+
- [ ] Enterprise customers
|
|
90
|
+
|
|
91
|
+
### Feedback Period
|
|
92
|
+
**Duration**: [e.g., 2 weeks]
|
|
93
|
+
**Deadline**: [date]
|
|
94
|
+
|
|
95
|
+
## Implementation Timeline
|
|
96
|
+
### Phase 1: Design
|
|
97
|
+
- [ ] RFC discussion
|
|
98
|
+
- [ ] Design finalization
|
|
99
|
+
- [ ] Approval
|
|
100
|
+
|
|
101
|
+
### Phase 2: Implementation
|
|
102
|
+
- [ ] Core implementation
|
|
103
|
+
- [ ] Tests
|
|
104
|
+
- [ ] Documentation
|
|
105
|
+
|
|
106
|
+
### Phase 3: Release
|
|
107
|
+
- [ ] Beta release
|
|
108
|
+
- [ ] Feedback collection
|
|
109
|
+
- [ ] Stable release
|
|
110
|
+
|
|
111
|
+
## Success Metrics
|
|
112
|
+
How will we measure success?
|
|
113
|
+
- Metric 1
|
|
114
|
+
- Metric 2
|
|
115
|
+
|
|
116
|
+
## References
|
|
117
|
+
- Related RFCs:
|
|
118
|
+
- External documentation:
|
|
119
|
+
- Prior art:
|
|
120
|
+
|
|
121
|
+
## Open Questions for Community
|
|
122
|
+
1. Question 1?
|
|
123
|
+
2. Question 2?
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
**Note**: This RFC is open for community discussion. Please provide feedback in the comments below.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Security Vulnerability Report
|
|
3
|
+
about: Report a security vulnerability (use only for non-critical issues)
|
|
4
|
+
title: '[SECURITY] '
|
|
5
|
+
labels: 'security'
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## ⚠️ IMPORTANT: Private Disclosure Required
|
|
12
|
+
|
|
13
|
+
**For critical security vulnerabilities, DO NOT use this template.**
|
|
14
|
+
Follow the process in [SECURITY.md](../SECURITY.md) for responsible disclosure.
|
|
15
|
+
|
|
16
|
+
Use this template only for:
|
|
17
|
+
- Security improvements
|
|
18
|
+
- Non-critical security suggestions
|
|
19
|
+
- Security documentation updates
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Security Issue
|
|
24
|
+
|
|
25
|
+
**Severity**:
|
|
26
|
+
<!-- Low, Medium, or informational only -->
|
|
27
|
+
|
|
28
|
+
## Description
|
|
29
|
+
<!-- Describe the security concern or improvement suggestion -->
|
|
30
|
+
|
|
31
|
+
## Affected Components
|
|
32
|
+
<!-- List the affected files, features, or components -->
|
|
33
|
+
|
|
34
|
+
## Suggested Mitigation
|
|
35
|
+
<!-- Describe how this could be addressed -->
|
|
36
|
+
|
|
37
|
+
## Standards Reference
|
|
38
|
+
Does this relate to security standards in [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli)?
|
|
39
|
+
- [ ] SPDX license identifiers
|
|
40
|
+
- [ ] Secret management
|
|
41
|
+
- [ ] Dependency security
|
|
42
|
+
- [ ] Access control
|
|
43
|
+
- [ ] Other: [specify]
|
|
44
|
+
|
|
45
|
+
## Additional Context
|
|
46
|
+
<!-- Add any other context about the security concern -->
|
|
47
|
+
|
|
48
|
+
## Checklist
|
|
49
|
+
- [ ] This is NOT a critical vulnerability requiring private disclosure
|
|
50
|
+
- [ ] I have reviewed the SECURITY.md policy
|
|
51
|
+
- [ ] I have provided sufficient detail for evaluation
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Version Bump
|
|
3
|
+
about: Request or track a version change
|
|
4
|
+
title: '[VERSION] '
|
|
5
|
+
labels: 'version, type: version'
|
|
6
|
+
assignees: 'jmiller'
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Version Change
|
|
10
|
+
|
|
11
|
+
**Current version**: <!-- e.g., 01.02.03 -->
|
|
12
|
+
**Requested version**: <!-- e.g., 01.03.00 -->
|
|
13
|
+
**Change type**: <!-- patch / minor / major -->
|
|
14
|
+
|
|
15
|
+
## Reason
|
|
16
|
+
|
|
17
|
+
<!-- Why is this version bump needed? -->
|
|
18
|
+
|
|
19
|
+
## Checklist
|
|
20
|
+
|
|
21
|
+
- [ ] README.md `VERSION:` field updated
|
|
22
|
+
- [ ] CHANGELOG.md entry added
|
|
23
|
+
- [ ] Manifest/descriptor version updated (Joomla: `<version>`, NPM/MCP: `package.json`, client: theme manifest)
|
|
24
|
+
- [ ] All file headers will be auto-propagated by `sync-version-on-merge` workflow
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
2
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
name: "Resolve source dir"
|
|
5
|
+
description: >-
|
|
6
|
+
Resolve the repository source directory from the Makefile SRC_DIR (the repo's
|
|
7
|
+
single source of truth), falling back to source/ when the Makefile is absent
|
|
8
|
+
or does not declare SRC_DIR. The per-repo metadata API is no longer consulted.
|
|
9
|
+
|
|
10
|
+
inputs:
|
|
11
|
+
mokogit_token:
|
|
12
|
+
description: "Deprecated/ignored. Retained for caller compatibility; the metadata API is no longer used."
|
|
13
|
+
required: false
|
|
14
|
+
default: ""
|
|
15
|
+
strict:
|
|
16
|
+
description: "Deprecated/ignored. Retained for caller compatibility."
|
|
17
|
+
required: false
|
|
18
|
+
default: "false"
|
|
19
|
+
|
|
20
|
+
outputs:
|
|
21
|
+
source_dir:
|
|
22
|
+
description: "Resolved source directory with trailing slash (e.g. source/)"
|
|
23
|
+
value: ${{ steps.resolve.outputs.source_dir }}
|
|
24
|
+
source_glob:
|
|
25
|
+
description: "Recursive glob for the source directory (e.g. source/**)"
|
|
26
|
+
value: ${{ steps.resolve.outputs.source_glob }}
|
|
27
|
+
|
|
28
|
+
runs:
|
|
29
|
+
using: "composite"
|
|
30
|
+
steps:
|
|
31
|
+
- id: resolve
|
|
32
|
+
shell: bash
|
|
33
|
+
run: |
|
|
34
|
+
set -euo pipefail
|
|
35
|
+
|
|
36
|
+
normalize() {
|
|
37
|
+
# Trim whitespace, strip surrounding quotes, ensure single trailing slash.
|
|
38
|
+
# A resolved value of "." / "./" (repo root) is treated as invalid -> empty.
|
|
39
|
+
local v="$1"
|
|
40
|
+
v="$(printf '%s' "$v" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
|
41
|
+
v="${v%\"}"; v="${v#\"}"
|
|
42
|
+
v="${v%\'}"; v="${v#\'}"
|
|
43
|
+
v="$(printf '%s' "$v" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
|
|
44
|
+
[ -z "$v" ] && { printf ''; return; }
|
|
45
|
+
v="${v%/}/"
|
|
46
|
+
if [ "$v" = "./" ] || [ "$v" = "." ]; then
|
|
47
|
+
printf ''
|
|
48
|
+
return
|
|
49
|
+
fi
|
|
50
|
+
printf '%s' "$v"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# --- Makefile SRC_DIR (single source of truth) -----------------------
|
|
54
|
+
MAKE_DIR=""
|
|
55
|
+
if [ -f Makefile ]; then
|
|
56
|
+
RAW=$(awk -F':= *' '/^SRC_DIR[[:space:]]*:=/{print $2}' Makefile | head -n1)
|
|
57
|
+
if [ -z "$RAW" ]; then
|
|
58
|
+
RAW=$(awk -F'\?= *' '/^SRC_DIR[[:space:]]*\?=/{print $2}' Makefile | head -n1)
|
|
59
|
+
fi
|
|
60
|
+
MAKE_DIR="$(normalize "$RAW")"
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# --- Resolve (Makefile SRC_DIR, else source/ default) ----------------
|
|
64
|
+
if [ -n "$MAKE_DIR" ]; then
|
|
65
|
+
SOURCE_DIR="$MAKE_DIR"
|
|
66
|
+
else
|
|
67
|
+
SOURCE_DIR="source/"
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
echo "Resolved source_dir: ${SOURCE_DIR}"
|
|
71
|
+
echo "source_dir=${SOURCE_DIR}" >> "$GITHUB_OUTPUT"
|
|
72
|
+
echo "source_glob=${SOURCE_DIR}**" >> "$GITHUB_OUTPUT"
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
2
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
3
|
+
#
|
|
4
|
+
# FILE INFORMATION
|
|
5
|
+
# DEFGROUP: MokoGIT.Workflow
|
|
6
|
+
# INGROUP: MokoCLI.Universal
|
|
7
|
+
# REPO: https://git.mokoconsulting.tech/MokoConsulting/Template-Generic
|
|
8
|
+
# PATH: /.mokogit/workflows/apidocs.yml
|
|
9
|
+
#
|
|
10
|
+
# apidocs.yml — UNIVERSAL API-docs → wiki (synced to every repo via the universal
|
|
11
|
+
# profile). One platform-detecting workflow that generates an API reference from the
|
|
12
|
+
# repo's own source and publishes it to the repo's OWN wiki:
|
|
13
|
+
# - joomla / php / library / module / component / package -> `docs:php-reference` -> "PHP-Reference"
|
|
14
|
+
# - go -> `docs:go-reference` -> "Go-Reference"
|
|
15
|
+
# - mcp -> `docs:mcp-reference` -> "MCP-Reference"
|
|
16
|
+
# - npm / electron (TS/JS) -> `docs:ts-reference` -> "TS-Reference"
|
|
17
|
+
# Platform + source dir are read from the repo Makefile (PLATFORM / SRC_DIR), with
|
|
18
|
+
# content/file heuristics as a fallback. Fully fail-open (no MokoCLI / no source / no
|
|
19
|
+
# token / no wiki -> warn + skip; never blocks). Manual `workflow_dispatch` — a
|
|
20
|
+
# release-time auto-trigger can be layered later.
|
|
21
|
+
name: "Universal: API Docs -> Wiki"
|
|
22
|
+
|
|
23
|
+
on:
|
|
24
|
+
workflow_dispatch: {}
|
|
25
|
+
|
|
26
|
+
concurrency:
|
|
27
|
+
group: apidocs-${{ github.ref }}
|
|
28
|
+
cancel-in-progress: true
|
|
29
|
+
|
|
30
|
+
jobs:
|
|
31
|
+
apidocs:
|
|
32
|
+
name: Generate & publish API reference
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- name: Checkout repository
|
|
36
|
+
uses: actions/checkout@v4
|
|
37
|
+
|
|
38
|
+
- name: Setup PHP + git
|
|
39
|
+
run: |
|
|
40
|
+
if ! command -v php >/dev/null 2>&1; then
|
|
41
|
+
sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml >/dev/null 2>&1 || true
|
|
42
|
+
fi
|
|
43
|
+
php -v | head -1
|
|
44
|
+
git --version
|
|
45
|
+
|
|
46
|
+
- name: Setup MokoCLI tools
|
|
47
|
+
run: |
|
|
48
|
+
# Install mokocli FRESH from the MokoGIT Composer registry (PRIMARY); /opt
|
|
49
|
+
# is a FAILSAFE only. Registry /api/packages/** is anon-allowlisted (no
|
|
50
|
+
# token) and serves a dist zip (no git clone). The docs handlers ship in
|
|
51
|
+
# mokocli stable, so the registry copy has them.
|
|
52
|
+
if ! command -v composer >/dev/null 2>&1; then
|
|
53
|
+
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 || true
|
|
54
|
+
fi
|
|
55
|
+
rm -rf /tmp/mokocli
|
|
56
|
+
REG='{"type":"composer","url":"https://git.mokoconsulting.tech/api/packages/MokoConsulting/composer"}'
|
|
57
|
+
if composer create-project --no-install --no-interaction --no-progress --quiet \
|
|
58
|
+
--repository="${REG}" mokoconsulting/mokocli /tmp/mokocli >/dev/null 2>&1 \
|
|
59
|
+
&& [ -f /tmp/mokocli/cli/docs_php_reference.php ]; then
|
|
60
|
+
echo "MOKO_CLI=/tmp/mokocli/cli" >> "$GITHUB_ENV"
|
|
61
|
+
echo "Installed mokocli fresh from the Composer registry."
|
|
62
|
+
elif [ -f /opt/mokocli/cli/docs_php_reference.php ]; then
|
|
63
|
+
echo "::warning::Registry install failed — using /opt/mokocli FAILSAFE (may be stale)"
|
|
64
|
+
echo "MOKO_CLI=/opt/mokocli/cli" >> "$GITHUB_ENV"
|
|
65
|
+
else
|
|
66
|
+
echo "::warning::mokocli docs handlers unavailable — skipping API docs"
|
|
67
|
+
echo "MOKO_CLI=" >> "$GITHUB_ENV"
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
- name: Generate reference
|
|
71
|
+
id: gen
|
|
72
|
+
run: |
|
|
73
|
+
set +e
|
|
74
|
+
[ -z "$MOKO_CLI" ] && { echo "no mokocli — skipping"; exit 0; }
|
|
75
|
+
NAME="${{ github.event.repository.name }}"
|
|
76
|
+
|
|
77
|
+
PLATFORM=""; SRC=""; VER=""
|
|
78
|
+
if [ -f Makefile ]; then
|
|
79
|
+
PLATFORM="$(grep -m1 -E '^PLATFORM[[:space:]]*:?=' Makefile | sed -E 's/.*:?=[[:space:]]*//' | tr -d '[:space:]')"
|
|
80
|
+
SRC="$(grep -m1 -E '^SRC_DIR[[:space:]]*:?=' Makefile | sed -E 's/.*:?=[[:space:]]*//' | tr -d '[:space:]')"
|
|
81
|
+
VER="$(grep -m1 -E '^PROJECT_VERSION[[:space:]]*:?=' Makefile | sed -E 's/.*:?=[[:space:]]*//' | tr -d '[:space:]')"
|
|
82
|
+
fi
|
|
83
|
+
[ -z "$VER" ] && VER="$(date -u +%Y.%m.%d)"
|
|
84
|
+
if [ -z "$SRC" ]; then for d in source src htdocs; do [ -d "$d" ] && SRC="$d" && break; done; fi
|
|
85
|
+
[ -z "$SRC" ] && SRC="src"
|
|
86
|
+
|
|
87
|
+
# MCP servers are PLATFORM=npm, so the MCP content check MUST run before the
|
|
88
|
+
# npm->ts branch, else an MCP server gets a TS reference instead of a tools one.
|
|
89
|
+
KIND="php"
|
|
90
|
+
if [ "$PLATFORM" = "go" ] || { [ -z "$PLATFORM" ] && [ -f go.mod ]; }; then
|
|
91
|
+
KIND="go"
|
|
92
|
+
elif [ "$PLATFORM" = "mcp" ] || grep -rqsE 'new[[:space:]]+McpServer|server\.tool\(' "$SRC" 2>/dev/null; then
|
|
93
|
+
KIND="mcp"
|
|
94
|
+
elif [ "$PLATFORM" = "npm" ] || [ "$PLATFORM" = "electron" ] || { [ -z "$PLATFORM" ] && [ -f package.json ]; }; then
|
|
95
|
+
KIND="ts"
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
mkdir -p build
|
|
99
|
+
case "$KIND" in
|
|
100
|
+
mcp) php "$MOKO_CLI/docs_mcp_reference.php" --path . --src "$SRC" --name "$NAME" --output build/MCP-Reference.md
|
|
101
|
+
echo "page=MCP-Reference" >> "$GITHUB_OUTPUT"; echo "file=build/MCP-Reference.md" >> "$GITHUB_OUTPUT" ;;
|
|
102
|
+
go) php "$MOKO_CLI/docs_go_reference.php" --path . --src . --name "$NAME" --version "$VER" --output build/Go-Reference.md
|
|
103
|
+
echo "page=Go-Reference" >> "$GITHUB_OUTPUT"; echo "file=build/Go-Reference.md" >> "$GITHUB_OUTPUT" ;;
|
|
104
|
+
ts) php "$MOKO_CLI/docs_ts_reference.php" --path . --src "$SRC" --name "$NAME" --version "$VER" --output build/TS-Reference.md
|
|
105
|
+
echo "page=TS-Reference" >> "$GITHUB_OUTPUT"; echo "file=build/TS-Reference.md" >> "$GITHUB_OUTPUT" ;;
|
|
106
|
+
*) php "$MOKO_CLI/docs_php_reference.php" --path . --src "$SRC" --name "$NAME" --version "$VER" --output build/PHP-Reference.md
|
|
107
|
+
echo "page=PHP-Reference" >> "$GITHUB_OUTPUT"; echo "file=build/PHP-Reference.md" >> "$GITHUB_OUTPUT" ;;
|
|
108
|
+
esac
|
|
109
|
+
echo "kind=$KIND" >> "$GITHUB_OUTPUT"
|
|
110
|
+
echo "Generated $KIND reference from $SRC/."
|
|
111
|
+
|
|
112
|
+
- name: Publish to wiki
|
|
113
|
+
env:
|
|
114
|
+
TOKEN: ${{ github.token }}
|
|
115
|
+
run: |
|
|
116
|
+
set -e
|
|
117
|
+
FILE="${{ steps.gen.outputs.file }}"; PAGE="${{ steps.gen.outputs.page }}"
|
|
118
|
+
[ -n "$FILE" ] && [ -f "$FILE" ] || { echo "::warning::no reference generated — skipping publish"; exit 0; }
|
|
119
|
+
if [ -z "$TOKEN" ]; then echo "::warning::no MOKOGIT_TOKEN — skipping wiki publish"; exit 0; fi
|
|
120
|
+
REPO="${{ github.event.repository.name }}"; OWNER="${{ github.repository_owner }}"
|
|
121
|
+
rm -rf /tmp/wiki
|
|
122
|
+
if ! git clone -q "https://x-access-token:${TOKEN}@git.mokoconsulting.tech/${OWNER}/${REPO}.wiki.git" /tmp/wiki 2>/dev/null; then
|
|
123
|
+
echo "::warning::wiki clone failed (wiki may not be initialised) — skipping"; exit 0
|
|
124
|
+
fi
|
|
125
|
+
cp "$FILE" "/tmp/wiki/${PAGE}.md"
|
|
126
|
+
cd /tmp/wiki
|
|
127
|
+
git config user.name "Moko Consulting"; git config user.email "hello@mokoconsulting.tech"
|
|
128
|
+
git add -A
|
|
129
|
+
if git diff --cached --quiet; then echo "wiki already up to date"; exit 0; fi
|
|
130
|
+
git commit -q -m "docs(wiki): update ${PAGE} (moko ${{ steps.gen.outputs.kind }} docs) [skip ci]"
|
|
131
|
+
git push -q origin HEAD:main
|
|
132
|
+
echo "Published ${PAGE} to ${OWNER}/${REPO} wiki."
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
2
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
3
|
+
#
|
|
4
|
+
# FILE INFORMATION
|
|
5
|
+
# DEFGROUP: GitHub.Workflow
|
|
6
|
+
# INGROUP: MokoStandards.Workflows.Shared
|
|
7
|
+
# REPO: https://github.com/mokoconsulting-tech/MokoStandards
|
|
8
|
+
# PATH: /.mokogit/workflows/auto-assign.yml
|
|
9
|
+
# VERSION: 04.06.00
|
|
10
|
+
# BRIEF: Auto-assign jmiller to unassigned issues and PRs every 15 minutes
|
|
11
|
+
|
|
12
|
+
name: "Universal: Auto-Assign"
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
issues:
|
|
16
|
+
types: [opened]
|
|
17
|
+
pull_request_target:
|
|
18
|
+
types: [opened]
|
|
19
|
+
schedule:
|
|
20
|
+
- cron: '0 */12 * * *'
|
|
21
|
+
workflow_dispatch:
|
|
22
|
+
|
|
23
|
+
permissions:
|
|
24
|
+
issues: write
|
|
25
|
+
pull-requests: write
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
auto-assign:
|
|
29
|
+
name: Assign unassigned issues and PRs
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- name: Assign unassigned issues
|
|
34
|
+
env:
|
|
35
|
+
GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
|
|
36
|
+
run: |
|
|
37
|
+
REPO="${{ github.repository }}"
|
|
38
|
+
ASSIGNEE="jmiller"
|
|
39
|
+
|
|
40
|
+
echo "## 🏷️ Auto-Assign Report" >> $GITHUB_STEP_SUMMARY
|
|
41
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
42
|
+
|
|
43
|
+
ASSIGNED_ISSUES=0
|
|
44
|
+
ASSIGNED_PRS=0
|
|
45
|
+
|
|
46
|
+
# Assign unassigned open issues
|
|
47
|
+
ISSUES=$(gh api "repos/$REPO/issues?state=open&per_page=100&assignee=none" --jq '.[].number' 2>/dev/null || true)
|
|
48
|
+
for NUM in $ISSUES; do
|
|
49
|
+
# Skip PRs (the issues endpoint returns PRs too)
|
|
50
|
+
IS_PR=$(gh api "repos/$REPO/issues/$NUM" --jq '.pull_request // empty' 2>/dev/null || true)
|
|
51
|
+
if [ -z "$IS_PR" ]; then
|
|
52
|
+
gh api "repos/$REPO/issues/$NUM/assignees" -X POST -f "assignees[]=$ASSIGNEE" --silent 2>/dev/null && {
|
|
53
|
+
ASSIGNED_ISSUES=$((ASSIGNED_ISSUES + 1))
|
|
54
|
+
echo " Assigned issue #$NUM"
|
|
55
|
+
} || true
|
|
56
|
+
fi
|
|
57
|
+
done
|
|
58
|
+
|
|
59
|
+
# Assign unassigned open PRs
|
|
60
|
+
PRS=$(gh api "repos/$REPO/pulls?state=open&per_page=100" --jq '.[] | select(.assignees | length == 0) | .number' 2>/dev/null || true)
|
|
61
|
+
for NUM in $PRS; do
|
|
62
|
+
gh api "repos/$REPO/issues/$NUM/assignees" -X POST -f "assignees[]=$ASSIGNEE" --silent 2>/dev/null && {
|
|
63
|
+
ASSIGNED_PRS=$((ASSIGNED_PRS + 1))
|
|
64
|
+
echo " Assigned PR #$NUM"
|
|
65
|
+
} || true
|
|
66
|
+
done
|
|
67
|
+
|
|
68
|
+
echo "| Type | Assigned |" >> $GITHUB_STEP_SUMMARY
|
|
69
|
+
echo "|------|----------|" >> $GITHUB_STEP_SUMMARY
|
|
70
|
+
echo "| Issues | $ASSIGNED_ISSUES |" >> $GITHUB_STEP_SUMMARY
|
|
71
|
+
echo "| Pull Requests | $ASSIGNED_PRS |" >> $GITHUB_STEP_SUMMARY
|
|
72
|
+
|
|
73
|
+
if [ "$ASSIGNED_ISSUES" -eq 0 ] && [ "$ASSIGNED_PRS" -eq 0 ]; then
|
|
74
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
75
|
+
echo "✅ All issues and PRs already have assignees" >> $GITHUB_STEP_SUMMARY
|
|
76
|
+
fi
|