Skip to content

fix(build): add -DmcVersion to build.yml for correct 26.x Loom selection #11

fix(build): add -DmcVersion to build.yml for correct 26.x Loom selection

fix(build): add -DmcVersion to build.yml for correct 26.x Loom selection #11

Workflow file for this run

name: Sync shared files across branches
on:
push:
branches:
- dev
paths:
- README.md
- README_FR.md
- versions.json
- compile-all.sh
- .github/workflows/**
jobs:
sync:
if: ${{ !contains(github.event.head_commit.message, '[skip sync]') }}
runs-on: ubuntu-latest
steps:
- name: Checkout source branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Sync shared files to all branches
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
SOURCE_BRANCH="${GITHUB_REF#refs/heads/}"
TARGETS=("main")
SHARED_FILES=("README.md" "README_FR.md" "versions.json" "compile-all.sh" ".github/workflows/")
for target in "${TARGETS[@]}"; do
if [ "$target" = "$SOURCE_BRANCH" ]; then
continue
fi
if git show-ref --verify --quiet refs/remotes/origin/"$target"; then
git checkout "$target"
git checkout "$SOURCE_BRANCH" -- "${SHARED_FILES[@]}"
if ! git diff --cached --quiet; then
git commit -m "chore: sync shared files from $SOURCE_BRANCH [skip sync]"
git push origin "$target"
fi
fi
done