forked from drieslab/Giotto
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.2 KB
/
mirror_from_upstream.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Mirror from Upstream
on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight
workflow_dispatch: # Allow manual trigger
jobs:
mirror-from-upstream:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Set up Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Fastforward from upstream
run: |
git remote add upstream https://github.com/drieslab/Giotto.git
git fetch upstream
git checkout suite
- name: Check for new commits
id: check_commits
run: |
if git merge-base --is-ancestor HEAD upstream/suite; then
echo "No new commits to merge."
echo "has_new_commits=false" >> $GITHUB_OUTPUT
else
echo "New commits to merge."
echo "has_new_commits=true" >> $GITHUB_OUTPUT
fi
- name: Merge and push changes
if: steps.check_commits.outputs.has_new_commits == 'true'
run: |
git merge --ff-only upstream/suite
git push origin suite