Nightly trigger #1874
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly trigger | |
on: | |
schedule: | |
- cron: '0 2 * * *' | |
env: | |
NIGHTLY: nightly | |
TRUNK: master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout nightly | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.NIGHTLY }} | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Update nightly | |
run: | | |
# user and email are required for pushing | |
git config --local user.email "[email protected]" | |
git config --local user.name "Madlab's bot" | |
# fast forward to current master | |
git fetch origin ${TRUNK} | |
git merge origin/${TRUNK} --ff-only | |
- name: Push nightly | |
run: | | |
# push new commits to nightly | |
REMOTE="https://${BOT_USERNAME}:${BOT_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
git push "${REMOTE}" "HEAD:${NIGHTLY}" | |
env: | |
BOT_USERNAME: madlab-bot | |
BOT_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} |