Sync with upstream #283
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 * * *' # every day at midnight | |
workflow_dispatch: | |
jobs: | |
merge-upstream: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_PAT }} | |
- name: Setup git | |
run: | | |
git config --global user.email ${{ github.repository_owner_id }}+${{ github.repository_owner }}@users.noreply.github.com | |
git config --global user.name ${{ github.repository_owner }} | |
git config --global pull.rebase false | |
- name: Merge changes from main | |
run: | | |
git pull https://github.com/tachiyomiorg/tachiyomi-extensions master --no-edit -X theirs | |
- name: Compare changes | |
id: compare | |
run: | | |
git diff --name-only HEAD origin/main | |
echo "changes=$(git diff --name-only HEAD origin/main | tr '\n' ' ' )" >> "$GITHUB_OUTPUT" | |
- name: Push all changes | |
if: ${{ steps.compare.outputs.changes != '' }} | |
run: | | |
git push origin main | |
- name: Trigger build | |
uses: peter-evans/[email protected] | |
if: ${{ steps.compare.outputs.changes != '' }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
event-type: build | |