File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : ' Upstream Sync'
2
+
3
+ on :
4
+ schedule :
5
+ - cron : ' 0 21 * * 1-6'
6
+
7
+ workflow_dispatch : # click the button on Github repo!
8
+
9
+ jobs :
10
+ sync_latest_from_upstream :
11
+ runs-on : ubuntu-latest
12
+ name : Sync latest commits from upstream repo
13
+
14
+ steps :
15
+ # REQUIRED step
16
+ # Step 1: run a standard checkout action, provided by github
17
+ - name : Checkout target repo
18
+ uses : actions/checkout@v3
19
+ with :
20
+ ref : master
21
+
22
+ # REQUIRED step
23
+ # Step 2: run the sync action
24
+ - name : Sync upstream changes
25
+ id : sync
26
+
27
+ with :
28
+ target_sync_branch : master
29
+ # REQUIRED 'target_repo_token' exactly like this!
30
+ target_repo_token : ${{ secrets.GITHUB_TOKEN }}
31
+ upstream_sync_branch : master
32
+ upstream_sync_repo : clearlydefined/curated-data
33
+
34
+ # Step 3: Display a sample message based on the sync output var 'has_new_commits'
35
+ - name : New commits found
36
+ if : steps.sync.outputs.has_new_commits == 'true'
37
+ run : echo "New commits were found to sync."
38
+
39
+ - name : No new commits
40
+ if : steps.sync.outputs.has_new_commits == 'false'
41
+ run : echo "There were no new commits."
42
+
43
+ - name : Show value of 'has_new_commits'
44
+ run : echo ${{ steps.sync.outputs.has_new_commits }}
You can’t perform that action at this time.
0 commit comments