Skip to content

Sync upstream

Sync upstream #405

Workflow file for this run

name: Sync upstream
on:
workflow_call:
workflow_dispatch:
schedule:
- cron: "0 15 * * *"
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: sync
id: sync
shell: bash
run: |
git config --global user.name 'j-hc'
git config --global user.email '[email protected]'
if [[ $(git log | grep Author | head -1) == *"semantic"* ]]; then
git reset --hard HEAD~1
fi
T=$(git tag --sort=creatordate | tail -1)
git remote add upstream https:/revanced/revanced-cli
git tag -d $(git tag -l)
git fetch upstream --tags -f
C=$(git rev-list --left-right --count origin/main...remotes/upstream/main | awk '{print$2}')
echo "ahead $C commits."
if [ "$C" -gt 0 ]; then
echo "rebase"
git push origin --delete $T
git rebase -X ours upstream/main
git push --tags -f
git push -f
else
echo "in sync"
fi