Skip to content

sync-fork-daily-once #195

sync-fork-daily-once

sync-fork-daily-once #195

name: sync-fork-daily-once
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch: { }
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
- name: Sync fork
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote add upstream https://github.com/curl/curl.git
git fetch upstream
git checkout ${{ github.ref_name }}
git merge --no-ff --no-commit upstream/${{ github.ref_name }}
git reset HEAD .github/workflows
git checkout -- .github/workflows
git commit -m "Sync with upstream (excluding workflows)"
git push origin ${{ github.ref_name }}