-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathopenwiki-update.gitlab-ci.yml
More file actions
41 lines (41 loc) · 1.89 KB
/
Copy pathopenwiki-update.gitlab-ci.yml
File metadata and controls
41 lines (41 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
openwiki_update:
image: node:22
stage: deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "web"'
before_script:
- apt-get update && apt-get install -y git curl
# mermaid + jsdom are optional; they add high-fidelity validation of Mermaid diagrams. Remove if your wiki has none.
- npm install --global openwiki mermaid@11.16.0 jsdom@29.1.1
- git config user.name "${GITLAB_USER_NAME:-OpenWiki Bot}"
- git config user.email "${GITLAB_USER_EMAIL:-openwiki@example.com}"
script:
- openwiki code --update --print
- |
if git diff --quiet -- openwiki AGENTS.md CLAUDE.md .github/workflows/openwiki-update.yml; then
echo "OpenWiki is already up to date."
exit 0
fi
- export OPENWIKI_BRANCH="openwiki/update-${CI_PIPELINE_ID}"
- git checkout -b "$OPENWIKI_BRANCH"
- git add openwiki AGENTS.md CLAUDE.md .github/workflows/openwiki-update.yml
- git commit -m "docs: update OpenWiki"
- git push "https://oauth2:${OPENWIKI_GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git" "$OPENWIKI_BRANCH"
- |
curl --fail --request POST \
--header "PRIVATE-TOKEN: ${OPENWIKI_GITLAB_TOKEN}" \
--form "source_branch=${OPENWIKI_BRANCH}" \
--form "target_branch=${CI_DEFAULT_BRANCH}" \
--form "title=docs: update OpenWiki" \
--form "description=Automated OpenWiki documentation update generated by the scheduled GitLab pipeline." \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/merge_requests"
variables:
# Full history so `openwiki code --update` can diff HEAD against the commit
# it last documented; GitLab's default shallow clone hides that commit and
# the update runs against an empty change summary.
GIT_DEPTH: "0"
OPENWIKI_PROVIDER: openrouter
OPENWIKI_MODEL_ID: z-ai/glm-5.2
LANGCHAIN_PROJECT: openwiki
LANGCHAIN_TRACING_V2: "true"