This repository contains GitHub Actions workflows boilerplate that you want to sync to other repositories. This saves your time so you only make changes to common workflow YAMLs in one place without doing it in each repository one by one.
This works by creating a new GitHub Actions workflow in your target repositories and it will automatically sync files or folders from this repository. The workflow can be customized so it only overwrites or deletes specific files and folders.
graph LR;
source("Source repository")
target1("Target repository 1")
target2("Target repository 2")
target3("Target repository 3")
targetn("Target repository n")
source --pull--> target1
source --pull--> target2
source --pull--> target3
source --pull--> targetn
This sync process is designed to work well with GitHub Flow.
-
Generate a new Personal Access Token with proper permissions as follow:
- For classic token, choose
repo
andworkflow
. - For fine-grained token, choose the following:
Repository:Contents=Read and write Repository:Metadata=Read-only Repository:Secrets=Read and write Repository:Workflows=Read and write
- For classic token, choose
-
Manually run the workflow Sync Secrets and input your target repository.
-
In your target reposotory, create a new workflow
.github/workflows/sync.yml
copy the content from sync.yml. -
Get the workflow runs and it will automatically sync files and folders which you can customize in sync.yml