Sync with Upstream #40
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 with Upstream | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: setup | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
- name: merge upstream | |
run: | | |
git remote add upstream https://git.eaglercraft.rip/eaglercraft/eaglercraft-builds.git | |
git fetch upstream | |
git checkout main | |
git merge upstream/main --strategy-option=theirs --allow-unrelated-histories | |
- name: add workflow | |
run: | | |
git reset HEAD .github/workflows/ | |
git checkout HEAD -- .github/workflows/ | |
if git diff --quiet; then | |
echo "No changes in .github/workflows/ to commit." | |
else | |
git commit -m "Hold Workflows" | |
fi | |
- name: push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |