0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-03-18 20:35:08 +01:00
nextcloud-docker/.github/workflows/update_fork.yml
2024-05-09 20:22:44 +02:00

39 lines
978 B
YAML

name: Sync Fork with Upstream
on:
schedule:
- cron: "30 23 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Git user
run: |
git config --global user.name "Arne Tarara"
git config --global user.email "arne@green-coding.io"
- name: Add remote repository
run: |
git remote add upstream https://github.com/nextcloud/docker
git fetch upstream
- name: Check for updates
run: |
CHANGES=$(git rev-list HEAD..upstream/master --count)
if [ "$CHANGES" -gt 0 ]; then
echo "Updating fork..."
git checkout ${{ github.ref_name }}
git merge upstream/master
git push
else
echo "No updates from the original repository."
fi