Skip to content

Publish Stable

Publish Stable #870

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