Skip to content

tanishqmanuja/sync-upstream-repo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sync Upstream Repo Fork

This is a Github Action used to merge changes from remote.

This is forked from dabreadman, with extra functionality from verticalsync.

Use case

  • Perserve a repo while keeping up-to-date (rather than to clone it).
  • Have a branch in sync with upstream, and pull changes into dev branch.

Example

name: Sync Upstream

env:
  # Required, URL to upstream (fork base)
  UPSTREAM_URL: "https://github.com/dabreadman/go-web-proxy.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 }}
  # Optional, defaults to main
  UPSTREAM_BRANCH: "main"
  # Optional, defaults to UPSTREAM_BRANCH
  DOWNSTREAM_BRANCH: ""
  # Optional fetch arguments
  FETCH_ARGS: ""
  # Optional merge arguments
  MERGE_ARGS: ""
  # Optional push arguments
  PUSH_ARGS: ""
  # Optional git config arguments
  GIT_CONFIG_ARGS: ""

# This runs every day on 1801 UTC
on:
  schedule:
    - cron: '1 18 * * *'
  # 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: ${{ env.UPSTREAM_URL }}
          upstream_branch: ${{ env.UPSTREAM_BRANCH }}
          downstream_branch: ${{ env.DOWNSTREAM_BRANCH }}
          token: ${{ env.WORKFLOW_TOKEN }}
          fetch_args: ${{ env.FETCH_ARGS }}
          merge_args: ${{ env.MERGE_ARGS }}
          push_args: ${{ env.PUSH_ARGS }}
          git_config_args: ${{ env.GIT_CONFIG_ARGS }}

About

📦 Github action: Sync and merge upstream repository with your current repository

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Shell 92.4%
  • Dockerfile 7.6%