Update RexPilot with latest FrogPilot #3
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: Rebase onto FrogPilot-Staging | |
on: | |
schedule: | |
- cron: "0 11 * * *" # This triggers the workflow daily at 11AM UTC / 4AM PT | |
workflow_dispatch: # This allows manual triggering | |
jobs: | |
rebase: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current branch | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches | |
- name: Set up Git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Fetch upstream branch | |
run: | | |
git remote add upstream https://github.com/FrogAi/FrogPilot.git | |
git fetch upstream | |
- name: Get second latest commit from upstream branch | |
id: get_commit | |
run: | | |
UPSTREAM_BRANCH="FrogPilot-Staging" # Replace with the upstream branch you want to rebase onto | |
SECOND_LATEST_COMMIT=$(git log upstream/$UPSTREAM_BRANCH --pretty=format:'%H' -n 2 | tail -n 1) | |
echo "Second latest commit: $SECOND_LATEST_COMMIT" | |
echo "commit=$SECOND_LATEST_COMMIT" >> $GITHUB_ENV | |
- name: Rebase current branch onto second latest commit | |
run: | | |
git rebase ${{ env.commit }} | |
- name: Push the rebased branch | |
run: | | |
git push --force-with-lease |