Skip to content

Sync upstream

Sync upstream #110

Workflow file for this run

name: Sync upstream
on:
schedule:
# 毎日 9:00 JST (0:00 UTC) に実行
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Add upstream remote
run: |
git remote add upstream https://github.com/nahisaho/MUSUBIX.git
git fetch upstream main
- name: Check for changes
id: check
run: |
if git diff --quiet main upstream/main; then
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "No changes from upstream."
else
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "Changes detected from upstream."
fi
- name: Fast-forward main to upstream/main
if: steps.check.outputs.changed == 'true'
run: |
git checkout main
git merge --ff-only upstream/main
- name: Push updated main
if: steps.check.outputs.changed == 'true'
run: git push origin main