Skip to content

Sync Fork with Upstream #13

Sync Fork with Upstream

Sync Fork with Upstream #13

Workflow file for this run

name: Sync Fork with Upstream
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Sync with upstream using rebase
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote add upstream https://github.com/typpo/textbelt.git 2>/dev/null || true
git fetch upstream
LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse upstream/master)
if [ "$LOCAL" = "$REMOTE" ]; then
echo "Already up to date"
exit 0
fi
git rebase upstream/master || {
echo "Rebase failed - manual intervention required"
git rebase --abort
exit 1
}
git push origin master --force-with-lease