Skip to content

Sync Fork Automatically #7

Sync Fork Automatically

Sync Fork Automatically #7

Workflow file for this run

name: Sync Fork Automatically
on:
schedule:
- cron: '0 */12 * * *' # Každých 12 hodín
workflow_dispatch: # Umožní manuálne spustenie
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Fork
uses: actions/checkout@v4
with:
fetch-depth: 0 # Aby sme mali celý git log
- name: Get Original Repository URL
id: get_upstream
run: |
UPSTREAM_URL=$(jq -r '.parent.html_url' <<< $(curl -s "https://api.github.com/repos/${{ github.repository }}"))
echo "UPSTREAM_URL=$UPSTREAM_URL" >> $GITHUB_ENV
- name: Sync Fork
run: |
git remote add upstream $UPSTREAM_URL || true
git fetch upstream
git checkout main
git merge upstream/main --allow-unrelated-histories
git push origin main