Skip to content

Sync Fork

Sync Fork #5

Workflow file for this run

name: Sync Fork
on:
schedule:
- cron: '0 0 * * *' # Runs at 12:00 AM UTC every day
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
sync:
if: github.event.repository.fork == true
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Ensure all history is fetched
# Step 2: Set up Git
- name: Set up Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Step 3: Add upstream remote
- name: Add upstream remote
run: git remote add upstream https://github.com/jman1593/jman1593.github.io.git
# Step 4: Fetch and sync with upstream
- name: Sync with upstream
run: |
git fetch upstream
git merge upstream/master master
git push origin master