https://www.youtube.com/watch?v=VOakLctEC2Q
Steps
name: Sync Upstream
env:
# Required, URL to upstream (fork base)
UPSTREAM_URL: "<https://github.com/hasanshahriar32/project.git>"
# Required, token to authenticate bot, could use ${{ secrets.GITHUB_TOKEN }}
# Over here, we use a PAT instead to authenticate workflow file changes.
WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
# This runs every day on 1801 UTC
on:
schedule:
- cron: '0 6 * * *'
# Allows manual workflow run (must in default branch to work)
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: GitHub Sync to Upstream Repository
uses: dabreadman/sync-upstream-repo@v1.3.0
with:
upstream_repo: <https://github.com/hasanshahriar32/project.git>
upstream_branch: main
downstream_branch: main
token: ${{ secrets.WORKFLOW_TOKEN }}