Sync with Upstream #60
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 * * *' # Daily at midnight | |
workflow_dispatch: | |
jobs: | |
sync: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Set up Git | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email '[email protected]' | |
- name: Add Upstream Remote | |
run: git remote add upstream https://github.com/Paroxity/portal.git | |
- name: Fetch Upstream | |
run: git fetch upstream master | |
- name: Merge Upstream Changes | |
run: | | |
git checkout master | |
git merge upstream/master --strategy-option theirs --no-commit | |
git restore --source=HEAD --staged README.md .github/ | |
if git diff-index --quiet HEAD; then | |
echo "No changes to commit" | |
else | |
git commit -m "Merge upstream changes" | |
fi | |
- name: Push Changes | |
env: | |
GH_PAT: ${{ secrets.GH_PAT }} | |
run: | | |
git push https://[email protected]/PixelRidge-Softworks/portal.git master |