-
Notifications
You must be signed in to change notification settings - Fork 4
48 lines (41 loc) · 1.24 KB
/
rolling.yml
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
45
46
47
name: Nightly Build
on:
schedule:
- cron: "0 */12 * * *"
jobs:
check_changes:
name: Check changes to src
runs-on: 'ubuntu-20.04'
# Declare outputs for next jobs
outputs:
src_changed: ${{ steps.check_file_changed.outputs.src_changed }}
steps:
- uses: actions/checkout@v2
with:
# Checkout as many commits as needed for the diff
fetch-depth: 2
- shell: pwsh # the example this is adopted from makes use of PowerShell
id: check_file_changed
run: |
# diff HEAD W/ previous commit
$diff = git diff --name-only HEAD^ HEAD
$HasDiff = $SourceDiff.Length -gt 0
Write-Host "::set-output name=src_changed::$HasDiff"
merge:
needs: [ check_changes ]
if: needs.check_changes.outputs.tests_changed == 'True'
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.gpmp_BOT_ACCT }}
- name: Merge with main
run: |
git config user.name "gpmp-bot"
git config user.email "[email protected]"
git switch main
git merge --squash origin/rolling
git commit -m "#NIGHTLY: Merging rolling -> main"
git push