Skip to content

Commit

Permalink
Upstream sync
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneTR committed Oct 3, 2024
1 parent 0862ae8 commit 86b5a03
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/sync_upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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@v4
with:
fetch-depth: 0

- name: Set up Git user
run: |
git config --global user.name "Arne Tarara - Automated"
git config --global user.email "[email protected]"
- name: Add remote repository
run: |
git remote add upstream https://github.com/wagtail/bakerydemo
git fetch upstream
- name: Check for updates
run: |
CHANGES=$(git rev-list HEAD..upstream/main --count)
if [ "$CHANGES" -gt 0 ]; then
echo "Updating fork main branch..."
git checkout main
git merge upstream/main
git push
echo "Updating fork gmt-pinned-versions branch..."
git checkout gmt-pinned-versions
git merge upstream/main
git push
else
echo "No updates from the original repository."
fi

0 comments on commit 86b5a03

Please sign in to comment.