-
Notifications
You must be signed in to change notification settings - Fork 10
42 lines (36 loc) · 1.08 KB
/
publish_stable.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
name: Publish Stable
on:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
publish:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'wpilibsuite' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Merge
run: |
git config user.name github-actions
git config user.email [email protected]
git config pull.ff only
git fetch origin main
(git checkout main && git pull) || git checkout -b main origin/main
git fetch origin stable
(git checkout stable && git pull) || git checkout -b stable origin/stable
if git merge-base --is-ancestor main stable; then
echo "No merge is necessary"
exit 0
fi;
git merge --ff-only main
- name: Push
if: env.PUBLISH_STABLE == 'true' || github.event.action == 'workflow_dispatch'
env:
PUBLISH_STABLE: ${{ secrets.PUBLISH_STABLE }}
run: |
git push origin stable