docs(ci): Front-Matter + CI-Docs + YT-Sync vorbereitet (MP-7)

This commit is contained in:
2025-10-22 11:11:10 +02:00
parent 79c9d4a71a
commit 1bdd5c38aa
13 changed files with 310 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
## Ziel
Kurze Beschreibung des Ziels/Problems und was dieser PR löst.
## Änderungen
-
## Prüfliste (Definition of Done)
- [ ] CI grün (Backend/Docs)
- [ ] Doku-FrontMatter vorhanden und valide (`modul`, `status`, `summary`, optional `last_reviewed`, `review_cycle`, `yt_epic/yt_issues`)
- [ ] Links geprüft (CI LinkChecker läuft grün)
- [ ] Falls relevant: YouTrackKey im PRTitel/Commit enthalten (z. B. MP-7)
- [ ] Bei Architekturänderung: ADR aktualisiert und verlinkt
## Screenshots/Notizen (optional)
-
+89
View File
@@ -0,0 +1,89 @@
name: CI Docs
on:
pull_request:
paths:
- 'docs/**'
- '.junie/**'
- '.github/workflows/ci-docs.yml'
- '.markdownlint.yaml'
- '.vale.ini'
push:
branches: [ main ]
paths:
- 'docs/**'
- '.junie/**'
- '.github/workflows/ci-docs.yml'
- '.markdownlint.yaml'
- '.vale.ini'
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node (markdownlint)
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install markdownlint
run: npm i -g markdownlint-cli
- name: Markdownlint
run: markdownlint 'docs/**/*.md'
- name: Setup Vale
run: |
curl -fsSL https://install.goreleaser.com/github.com/errata-ai/vale.sh | sh
sudo mv bin/vale /usr/local/bin/vale
- name: Vale
run: vale docs/
- name: Link Checker
uses: lycheeverse/lychee-action@v1
with:
args: --verbose --no-progress 'docs/**/*.md'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Front-Matter Schema Validate
run: |
pip install pyyaml jsonschema
python .junie/scripts/validate-frontmatter.py
- name: Docs Drift Check
run: bash .junie/scripts/check-docs-drift.sh
- name: Render PlantUML
run: bash .junie/scripts/render-plantuml.sh
- name: Upload diagrams artifact
uses: actions/upload-artifact@v4
with:
name: diagrams
path: build/diagrams
- name: Validate YouTrack issues exist (optional)
if: ${{ env.YT_URL != '' && env.YT_TOKEN != '' }}
run: |
set -euo pipefail
KEYS=$(grep -Rho "[A-Z]\+-[0-9]\+" docs | sort -u || true)
if [ -z "$KEYS" ]; then
echo "No YouTrack keys found in docs."
exit 0
fi
echo "Prüfe Keys:" $KEYS
fail=0
for k in $KEYS; do
code=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer $YT_TOKEN" \
-H "Accept: application/json" \
"$YT_URL/api/issues/$k?fields=idReadable")
if [ "$code" != "200" ]; then
echo "[YT] Issue nicht gefunden: $k (HTTP $code)"; fail=1;
fi
done
exit $fail
env:
YT_URL: ${{ secrets.YT_URL }}
YT_TOKEN: ${{ secrets.YT_TOKEN }}
+29
View File
@@ -0,0 +1,29 @@
name: YouTrack Sync (on merge)
on:
push:
branches: [ main ]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Comment to YouTrack Issue(s)
run: |
set -euo pipefail
KEYS=$(git log -1 --pretty=%B | grep -o '[A-Z]\+-[0-9]\+' | sort -u || true)
if [ -z "$KEYS" ]; then
echo "No issue keys in last commit message. Skipping."
exit 0
fi
for ISSUE in $KEYS; do
MSG=$(printf 'PR/Commit gemergt: %s\nRepo: %s\nCommit: %s' "${{ github.event.head_commit.url }}" "${{ github.repository }}" "${{ github.sha }}")
curl -sS -X POST \
-H "Authorization: Bearer $YT_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"$YT_URL/api/issues/$ISSUE/comments" \
-d "{\"text\": \"$MSG\"}"
done
env:
YT_URL: ${{ secrets.YT_URL }}
YT_TOKEN: ${{ secrets.YT_TOKEN }}