Skip to content

Commit b40caf5

Browse files
committed
chore: remove version badges, add README sync workflow
1 parent 14e516d commit b40caf5

3 files changed

Lines changed: 49 additions & 7 deletions

File tree

.github/workflows/sync-readmes.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Sync READMEs across branches
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- 1.20.x
8+
- 1.21.x
9+
- 26.1.x
10+
paths:
11+
- README.md
12+
- README_FR.md
13+
14+
jobs:
15+
sync:
16+
if: ${{ !contains(github.event.head_commit.message, '[skip sync]') }}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout source branch
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Configure git
25+
run: |
26+
git config user.name "github-actions[bot]"
27+
git config user.email "github-actions[bot]@users.noreply.github.com"
28+
29+
- name: Sync READMEs to all branches
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
SOURCE_BRANCH="${GITHUB_REF#refs/heads/}"
34+
TARGETS=("dev" "1.20.x" "1.21.x" "26.1.x")
35+
36+
for target in "${TARGETS[@]}"; do
37+
if [ "$target" = "$SOURCE_BRANCH" ]; then
38+
continue
39+
fi
40+
41+
if git show-ref --verify --quiet refs/remotes/origin/"$target"; then
42+
git checkout "$target"
43+
git checkout "$SOURCE_BRANCH" -- README.md README_FR.md
44+
if ! git diff --cached --quiet; then
45+
git commit -m "docs: sync READMEs from $SOURCE_BRANCH [skip sync]"
46+
git push origin "$target"
47+
fi
48+
fi
49+
done

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# StackableTools (Kotlin Edition)
22

3-
[![Minecraft Version](https://img.shields.io/badge/Minecraft-1.21-blue.svg?style=for-the-badge&logo=minecraft)](https://www.minecraft.net/)
4-
[![Minecraft Version](https://img.shields.io/badge/Minecraft-1.21.1-blue.svg?style=for-the-badge&logo=minecraft)](https://www.minecraft.net/)
5-
[![Minecraft Version](https://img.shields.io/badge/Minecraft-1.21.4-blue.svg?style=for-the-badge&logo=minecraft)](https://www.minecraft.net/)
6-
[![Minecraft Version](https://img.shields.io/badge/Minecraft-1.21.11-blue.svg?style=for-the-badge&logo=minecraft)](https://www.minecraft.net/)
7-
8-
93
[![Fabric API](https://img.shields.io/badge/Loader-Fabric-orange.svg?style=for-the-badge)](https://fabricmc.net/)
104
[![License](https://img.shields.io/badge/License-CC0_1.0-green.svg?style=for-the-badge)](https://github.com/yoanndev90/StackableTools/blob/master/LICENSE)
115
[![GitHub Release](https://img.shields.io/github/v/release/YoannDev90/StackableTools?style=for-the-badge)](https://github.com/yoanndev90/StackableTools/releases)

README_FR.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# StackableTools (Édition Kotlin)
22

3-
[![Version Minecraft](https://img.shields.io/badge/Minecraft-1.21-1.21.11-blue.svg?style=for-the-badge&logo=minecraft)](https://www.minecraft.net/)
43
[![Fabric API](https://img.shields.io/badge/Loader-Fabric-orange.svg?style=for-the-badge)](https://fabricmc.net/)
54
[![Licence](https://img.shields.io/badge/License-CC0_1.0-green.svg?style=for-the-badge)](https://github.com/yoann/StackableTools/blob/master/LICENSE)
65
[![Release GitHub](https://img.shields.io/github/v/release/yoann/StackableTools?style=for-the-badge)](https://github.com/yoann/StackableTools/releases)

0 commit comments

Comments
 (0)