refactor(ci): use marker comments instead of regex for tracker workflow
Add TRACKER: HTML comment markers to COMPATIBILITY.md, README.md, and all 5 translation READMEs. Rewrite gitea-tracker.yml to use grep -n for precise line-based insertion and sed line-address editing. Markers introduced: - TRACKER:QUICK-REF-MAX — Quick Reference max tested version - TRACKER:VERSION-INSERT — Version History row insertion point - TRACKER:LATEST-VERIFIED — latest verified note version - TRACKER:BADGE — shields.io badge version - TRACKER:LATEST-TESTED — latest tested version in READMEs Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
41caba06c0
commit
5648f73d45
8 files changed
+43
-31
No files matched your search
@@ -31,11 +31,13 @@ jobs:
|
||||
NEW_VERSION=$(echo "$RELEASE_JSON" | jq -r '.tag_name')
|
||||
fi
|
||||
echo "New Gitea version: $NEW_VERSION"
|
||||
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
# Parse current max tested from COMPATIBILITY.md
|
||||
CURRENT=$(grep -oP 'Max Tested Gitea.*?\|\s*\*\*\K[0-9.]+' COMPATIBILITY.md)
|
||||
# Read current max-tested from the TRACKER:QUICK-REF-MAX marker line above it
|
||||
MARKER_LINE=$(grep -n 'TRACKER:QUICK-REF-MAX' COMPATIBILITY.md | cut -d: -f1)
|
||||
CURRENT=$(sed -n "$((MARKER_LINE - 1))p" COMPATIBILITY.md | grep -oP '\*\*[0-9.]+\*\*' | tail -1 | tr -d '*')
|
||||
echo "Current max tested: $CURRENT"
|
||||
|
||||
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "current_version=$CURRENT" >> $GITHUB_OUTPUT
|
||||
|
||||
if [ "$NEW_VERSION" = "$CURRENT" ]; then
|
||||
@@ -46,50 +48,58 @@ jobs:
|
||||
echo "skip=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Update COMPATIBILITY.md — Quick Reference
|
||||
# --- COMPATIBILITY.md ---
|
||||
|
||||
- name: COMPATIBILITY.md — Quick Reference (max tested version)
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
run: |
|
||||
NEW="${{ steps.version.outputs.new_version }}"
|
||||
sed -i "s/|\*\*\([0-9.]*\)\*\* | \*\*[0-9.]*\*\* |/\|\*\*\1\*\* | \*\*${NEW}\*\* |/" COMPATIBILITY.md
|
||||
# The Quick Reference row is the line directly above TRACKER:QUICK-REF-MAX
|
||||
MARKER=$(grep -n 'TRACKER:QUICK-REF-MAX' COMPATIBILITY.md | cut -d: -f1)
|
||||
TARGET=$((MARKER - 1))
|
||||
# Replace the last **X.Y.Z** in that line with the new version
|
||||
sed -i "${TARGET}s/\*\*[0-9.]*\*\* | ✅/**${NEW}** | ✅/" COMPATIBILITY.md
|
||||
|
||||
- name: Update COMPATIBILITY.md — Version History table
|
||||
- name: COMPATIBILITY.md — Version History table
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
run: |
|
||||
NEW="${{ steps.version.outputs.new_version }}"
|
||||
TODAY=$(date +%Y-%m-%d)
|
||||
# Insert new row after the table header (line with "|---|---")
|
||||
# Insert a new row right after TRACKER:VERSION-INSERT marker
|
||||
MARKER=$(grep -n 'TRACKER:VERSION-INSERT' COMPATIBILITY.md | cut -d: -f1)
|
||||
ROW="| **${NEW}** | ${TODAY} | ⏳ Pending Verification | TBD |"
|
||||
sed -i "/^|---/a ${ROW}" COMPATIBILITY.md
|
||||
sed -i "${MARKER}a ${ROW}" COMPATIBILITY.md
|
||||
|
||||
- name: Update COMPATIBILITY.md — latest verified note
|
||||
- name: COMPATIBILITY.md — latest verified note
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
run: |
|
||||
NEW="${{ steps.version.outputs.new_version }}"
|
||||
# Update the "Latest verified" note
|
||||
sed -i "s/Gitea [0-9.]* data contexts/Gitea ${NEW} data contexts/" COMPATIBILITY.md
|
||||
# Update version inline on the line with TRACKER:LATEST-VERIFIED
|
||||
sed -i "/TRACKER:LATEST-VERIFIED/s/Gitea [0-9.]*/Gitea ${NEW}/" COMPATIBILITY.md
|
||||
|
||||
- name: Update README.md badge
|
||||
# --- README.md ---
|
||||
|
||||
- name: README.md — badge and latest tested
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
run: |
|
||||
NEW="${{ steps.version.outputs.new_version }}"
|
||||
# Update the shields.io badge
|
||||
sed -i "s/\(tested\)-[0-9a-z.]*\(blue\)/\1-${NEW}\2/" README.md
|
||||
# Update the "Latest tested" line
|
||||
sed -i "s/Latest tested:\*\* Gitea [0-9.]*/Latest tested:** Gitea ${NEW}/" README.md
|
||||
# Badge: update version on the TRACKER:BADGE line
|
||||
sed -i "/TRACKER:BADGE/s/tested\)-[0-9a-z.]*\(blue\)/tested\)-${NEW}\2/" README.md
|
||||
# Latest tested: update version on the TRACKER:LATEST-TESTED line
|
||||
sed -i "/TRACKER:LATEST-TESTED/s/Gitea [0-9.]*/Gitea ${NEW}/" README.md
|
||||
|
||||
- name: Update README translations
|
||||
# --- Translation READMEs ---
|
||||
|
||||
- name: README translations — latest tested
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
run: |
|
||||
NEW="${{ steps.version.outputs.new_version }}"
|
||||
for f in docs/README.{ja,ko,ru,zh-CN,zh-TW}.md; do
|
||||
# Update version number in the compatibility section
|
||||
sed -i "s/テスト:\*\* Gitea [0-9.]*/テスト:** Gitea ${NEW}/" "$f"
|
||||
sed -i "s/테스트:\*\* Gitea [0-9.]*/테스트:** Gitea ${NEW}/" "$f"
|
||||
sed -i "s/проверка:\*\* Gitea [0-9.]*/проверка:** Gitea ${NEW}/" "$f"
|
||||
sed -i "s/测试:\*\* Gitea [0-9.]*/测试:** Gitea ${NEW}/" "$f"
|
||||
sed -i "s/測試:\*\* Gitea [0-9.]*/測試:** Gitea ${NEW}/" "$f"
|
||||
sed -i "/TRACKER:LATEST-TESTED/s/Gitea [0-9.]*/Gitea ${NEW}/" "$f"
|
||||
done
|
||||
|
||||
# --- Create PR ---
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.version.outputs.skip != 'true'
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
|
||||
+3
-1
@@ -6,9 +6,10 @@ This document tracks the compatibility between **Gitea Mail Templates** releases
|
||||
|
||||
| Template Release | Min Gitea | Max Tested Gitea | Status |
|
||||
|-----------------|-----------|-----------------|--------|
|
||||
<!-- TRACKER:QUICK-REF-MAX -->
|
||||
| **v1.0.x** | **1.25.0** | **1.26.4** | ✅ Active |
|
||||
|
||||
> **Latest verified:** All 11 templates pass validation against Gitea 1.26.4 data contexts.
|
||||
> **Latest verified:** All 11 templates pass validation against Gitea 1.26.4 data contexts. <!-- TRACKER:LATEST-VERIFIED -->
|
||||
|
||||
## Check Your Gitea Version
|
||||
|
||||
@@ -20,6 +21,7 @@ gitea --version
|
||||
|
||||
## Gitea Version History — Mail Template Impact
|
||||
|
||||
<!-- TRACKER:VERSION-INSERT -->
|
||||
| Gitea | Release Date | Mail Template Changes | Breaking? |
|
||||
|-------|-------------|----------------------|-----------|
|
||||
| **1.26.4** | 2026-06-21 | None — hotfix release | No |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
A curated collection of professionally designed, audience-driven email templates for self-hosted [Gitea](https://about.gitea.com) instances.
|
||||
|
||||
[](COMPATIBILITY.md)
|
||||
[](COMPATIBILITY.md) <!-- TRACKER:BADGE -->
|
||||
|
||||
> **110 template files — 10 visual styles, 11 email types each**
|
||||
|
||||
@@ -164,7 +164,7 @@ gitea-mail-templates/
|
||||
## Compatibility
|
||||
|
||||
- **Gitea 1.25+** — matches the refactored mail template directory structure (v1.25)
|
||||
- **Latest tested:** Gitea 1.26.4
|
||||
- **Latest tested:** Gitea 1.26.4 <!-- TRACKER:LATEST-TESTED -->
|
||||
- 100% variable-compatible with official Gitea templates — see [COMPATIBILITY.md](COMPATIBILITY.md) for the full matrix
|
||||
- Uses only built-in Gitea template functions and official translation keys
|
||||
- No custom template functions or locale patches required
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ cd tools && go run . dev
|
||||
## 互換性
|
||||
|
||||
- **Gitea 1.25+** — v1.25で導入されたメールテンプレートディレクトリ構造
|
||||
- **最新テスト:** Gitea 1.26.4
|
||||
- **最新テスト:** Gitea 1.26.4<!-- TRACKER:LATEST-TESTED -->
|
||||
- Gitea公式テンプレートと100%互換 — 詳細は [COMPATIBILITY.md](COMPATIBILITY.md)を参照
|
||||
|
||||
## ライセンス
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ cd tools && go run . dev
|
||||
## 호환성
|
||||
|
||||
- **Gitea 1.25+** — v1.25에서 도입된 메일 템플릿 디렉토리 구조 사용
|
||||
- **최신 테스트:** Gitea 1.26.4
|
||||
- **최신 테스트:** Gitea 1.26.4<!-- TRACKER:LATEST-TESTED -->
|
||||
- Gitea 공식 템플릿과 100% 호환 — 자세한 내용은 [COMPATIBILITY.md](../COMPATIBILITY.md) 참조
|
||||
|
||||
## 라이선스
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ cd tools && go run . dev
|
||||
## Совместимость
|
||||
|
||||
- **Gitea 1.25+** — структура директорий из v1.25
|
||||
- **Последняя проверка:** Gitea 1.26.4
|
||||
- **Последняя проверка:** Gitea 1.26.4<!-- TRACKER:LATEST-TESTED -->
|
||||
- 100% совместимость с официальными шаблонами Gitea — см. [COMPATIBILITY.md](COMPATIBILITY.md)
|
||||
|
||||
## Лицензия
|
||||
|
||||
@@ -79,7 +79,7 @@ cd tools && go run . dev
|
||||
## 兼容性
|
||||
|
||||
- **Gitea 1.25+** — v1.25 引入的邮件模板目录结构
|
||||
- **最新测试:** Gitea 1.26.4
|
||||
- **最新测试:** Gitea 1.26.4<!-- TRACKER:LATEST-TESTED -->
|
||||
- 与 Gitea 官方模板 100% 兼容 — 详见 [COMPATIBILITY.md](COMPATIBILITY.md)
|
||||
|
||||
## 许可证
|
||||
|
||||
@@ -74,7 +74,7 @@ cd tools && go run . dev
|
||||
## 相容性
|
||||
|
||||
- **Gitea 1.25+** — v1.25 引入的郵件模板目錄結構
|
||||
- **最新測試:** Gitea 1.26.4
|
||||
- **最新測試:** Gitea 1.26.4<!-- TRACKER:LATEST-TESTED -->
|
||||
- 與 Gitea 官方模板 100% 相容 — 詳見 [COMPATIBILITY.md](COMPATIBILITY.md)
|
||||
|
||||
## 授權
|
||||
|
||||
Reference in new issue
Block a user