Sync Fork with Upstream #9
This file contains hidden or 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 Fork with Upstream | |
on: | |
schedule: | |
- cron: '0 8 * * *' # Runs at 8 AM UTC daily | |
workflow_dispatch: # Allows manual trigger | |
permissions: | |
contents: write | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Set up Git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Add Upstream Remote | |
run: | | |
git remote | grep upstream || git remote add upstream https://github.com/jakobdylanc/llmcord.git | |
- name: Fetch Upstream | |
run: git fetch upstream | |
- name: Merge Upstream Changes | |
run: | | |
git merge upstream/main --allow-unrelated-histories || { echo 'Merge failed. Resolve conflicts manually.'; exit 1; } | |
- name: Push Changes | |
run: git push https://x-access-token:${GITHUB_TOKEN}@github.com/karoltheguy/llmcord.git main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |