A GitHub Action for syncing between two independent repositories using hard reset.
1.1K
A GitHub Action for syncing between two independent repositories using hard reset.
workflow "Sync workflow" {
resolves = ["repo-sync"]
on = "schedule(*/5 * * * *)"
}
action "repo-sync" {
uses = "docker://ddhhz/github-sync:0.0.1-alpha"
args = "$SOURCE_REPO $SOURCE_BRANCH:$DESTINATION_BRANCH"
secrets = ["GITHUB_TOKEN"]
}
GITHUB_TOKEN Must be checked under secrets.
If SOURCE_REPO is private or with another provider, either (1) set a SSH_PRIVATE_KEY secret and use the SSH clone url or (2) use an authenticated HTTPS repo clone url like https://username:[email protected]/username/repository.git.
The job may fail if upstream has a .workflow file present. Consider using git-sync instead.
*:* in place of $SOURCE_BRANCH:$DESTINATION_BRANCHThis will force sync ALL branches to match source repo. Branches that are created only in the destination repo will not be affected but all the other branches will be hard reset to match source repo. ⚠️ This does mean if upstream ever creates a branch that shares the name, your changes will be gone.
Content type
Image
Digest
Size
12.1 MB
Last updated
about 7 years ago
docker pull ddhhz/github-sync