# .github/workflows/example.yml

name: Fork Sync With Upstream

on:
  schedule:
     # actually, ~5 minutes is the highest
     # effective frequency you will get
    - cron:  '0 3 * * 1'
  workflow_dispatch: #run manually
      
jobs:
  merge:
    runs-on: ubuntu-latest
    steps:
      # Step 1: run a standard checkout action, provided by github
    - name: Checkout main
      uses: actions/checkout@v2.3.4
      with:
        ref: master
        fetch-depth: 0
        # submodules: 'recursive'     ### may be needed in your situation

    # Step 2: run this sync action - specify the upstream repo, upstream branch to sync with, and target sync branch
    - name: Sync-Fork-action
      #uses: XueMoMo/Sync-Fork-action@v1.0.6
      uses: aormsby/Fork-Sync-With-Upstream-action@v2.3
      with:
        upstream_repository: pawelmalak/flame
        upstream_branch: master
        target_branch: master
        #git_pull_rebase_config: true
        # git_pull_args: --ff-only                    # optional arg use, defaults to simple 'pull'
        # github_token: ${{ secrets.GITHUB_TOKEN }}   # optional, for accessing repos that require authentication

    # Step 3: Display a message if 'sync' step had new commits (simple test)
    - name: Check for new commits
      if: steps.sync.outputs.has_new_commits
      run: echo "There were new commits."

    # Step 4: Print a helpful timestamp for your records (not required, just nice)
    - name: Timestamp
      run: date
