File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change 1
- name : Merge Master into AAA_ForSesame and Push
1
+ name : Merge ApsimX Master into AAA_ForSesame and Push
2
2
3
3
on :
4
- push :
5
- branches :
6
- - master
4
+ schedule :
5
+ - cron : ' 0 */4 * * *' # Run every 4 hours (adjust as needed)
7
6
8
7
jobs :
9
8
merge_and_push :
@@ -22,14 +21,28 @@ jobs:
22
21
ref : AAA_ForSesame
23
22
path : ApsimNG
24
23
25
- - name : Merge Master into AAA_ForSesame
24
+ - name : Check for changes in ApsimX master
25
+ id : check_changes
26
+ run : |
27
+ cd ApsimNG
28
+ git remote add apsimx https://github.com/APSIMInitiative/ApsimX.git
29
+ git fetch apsimx master
30
+ if [ $(git rev-list --count apsimx/master..AAA_ForSesame) -gt 0 ]; then
31
+ echo "changes_exist=true" >> $GITHUB_OUTPUT
32
+ else
33
+ echo "changes_exist=false" >> $GITHUB_OUTPUT
34
+ fi
35
+
36
+ - name : Merge Master into AAA_ForSesame (if changes exist)
37
+ if : steps.check_changes.outputs.changes_exist == 'true'
26
38
run : |
27
39
cd ApsimNG
28
40
git config --global user.name 'GitHub Action'
29
41
git config --global user.email 'action@github.com'
30
42
git merge origin/master
31
43
32
- - name : Push AAA_ForSesame to ApsimNG
44
+ - name : Push AAA_ForSesame to ApsimNG (if changes exist)
45
+ if : steps.check_changes.outputs.changes_exist == 'true'
33
46
run : |
34
47
cd ApsimNG
35
48
git push
You can’t perform that action at this time.
0 commit comments