Sync #57
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: Sync | |
on: | |
schedule: | |
- cron: '0 6 * * *' | |
jobs: | |
auto-update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Push Changes | |
id: push_changes | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
export FEATURE_BRANCH="sync-feature-$(date +'%Y%m%d%H%M%S')" | |
git checkout -b $FEATURE_BRANCH | |
git remote add upstream https://github.com/Gadersd/llama2-burn.git | |
git fetch upstream | |
git merge upstream/main | |
if git diff --quiet; then | |
echo "No changes to sync. Exiting." | |
echo "PUSH_CHANGES=false" >> $GITHUB_ENV | |
exit 0 | |
fi | |
git push origin $FEATURE_BRANCH | |
echo "FEATURE_BRANCH=$FEATURE_BRANCH" >> $GITHUB_ENV | |
echo "PUSH_CHANGES=true" >> $GITHUB_ENV | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
if: env.PUSH_CHANGES == 'true' | |
with: | |
commit-message: 'Sync with upstream' | |
title: 'Sync with upstream' | |
branch: ${{ env.FEATURE_BRANCH }} | |
base: main | |
labels: auto-update |