You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Sync and merge upstream repository with your current repository
v0.1.2.b
This is a Github Action used to merge changes from remote.
This is forked from mheene, with me adding authentication using GitHub Token and downstream branch options due to the default branch naming changes.
- 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 github action here:
name: My_Pipeline_Name
###
env:
# Required, URL to upstream (fork base)
UPSTREAM_URL: "https://github.com/dabreadman/go-web-proxy.git"
# Optional, defaults to main
DOWNSTREAM_BRANCH: "main"
###
on:
schedule:
- cron: '30 * * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: GitHub Sync to Upstream Repository
uses: dabreadman/[email protected]
with:
upstream_repo: ${{ env.UPSTREAM_URL }}
branch: $$ env.DOWNSTREAM_BRANCH }}
token: ${{ secrets.GITHUB_TOKEN}}
This action syncs your repo (merge changes from remote
) at branch main
with the upstream repo https://github.com/dabreadman/go-web-proxy.git
every 30 minutes.
- Setup an environment using docker.
(Why do that when
Workflow
is inside an environment? I have no idea). - Pass arguments into
entrypoint.sh
. entrypoint.sh
does the heavy lifting.
git clone, set origin/upstream, fetch, merge, push.