File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Sync READMEs across branches
1+ name : Sync shared files across branches
22
33on :
44 push :
1010 paths :
1111 - README.md
1212 - README_FR.md
13+ - versions.json
14+ - compile-all.sh
15+ - .github/workflows/*.yml
1316
1417jobs :
1518 sync :
@@ -26,12 +29,13 @@ jobs:
2629 git config user.name "github-actions[bot]"
2730 git config user.email "github-actions[bot]@users.noreply.github.com"
2831
29- - name : Sync READMEs to all branches
32+ - name : Sync files to all branches
3033 env :
3134 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3235 run : |
3336 SOURCE_BRANCH="${GITHUB_REF#refs/heads/}"
3437 TARGETS=("dev" "1.20.x" "1.21.x" "26.1.x")
38+ FILES=(README.md README_FR.md versions.json compile-all.sh .github/workflows/)
3539
3640 for target in "${TARGETS[@]}"; do
3741 if [ "$target" = "$SOURCE_BRANCH" ]; then
4044
4145 if git show-ref --verify --quiet refs/remotes/origin/"$target"; then
4246 git checkout "$target"
43- git checkout "$SOURCE_BRANCH" -- README.md README_FR.md
47+
48+ for file in "${FILES[@]}"; do
49+ git checkout "$SOURCE_BRANCH" -- "$file" 2>/dev/null || true
50+ done
51+
4452 if ! git diff --cached --quiet; then
45- git commit -m "docs : sync READMEs from $SOURCE_BRANCH [skip sync]"
53+ git commit -m "chore : sync shared files from $SOURCE_BRANCH [skip sync]"
4654 git push origin "$target"
4755 fi
4856 fi
You can’t perform that action at this time.
0 commit comments