Skip to content

Sync Upstream

Sync Upstream #23

name: Sync Upstream
env:
# Required, URL to upstream (fork base)
UPSTREAM_URL: "https://github.com/kubernetes-sigs/cluster-api.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.GITHUB_TOKEN }}
# Optional, defaults to main
UPSTREAM_BRANCH: "main"
# Optional, defaults to UPSTREAM_BRANCH
DOWNSTREAM_BRANCH: "master"
# Optional fetch arguments
FETCH_ARGS: "--depth=1 --no-tags"
# Optional merge arguments
MERGE_ARGS: "--ff-only"
# Optional push arguments
#PUSH_ARGS: "--prune --porcelain --set-upstream"
# Optional toggle to spawn time logs (keeps action active)
SPAWN_LOGS: "true" # "true" or "false"
# This runs every Monday at 0400
on:
schedule:
- cron: '0 4 * * 1'
# 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/[email protected]
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 }}
spawn_logs: ${{ env.SPAWN_LOGS }}