A collection of automation scripts and GitHub Actions workflows for common repository management tasks.
-
scripts/clone-all-repos.sh— Clone (or update) all repositories for a given GitHub owner or organization using theghCLI../scripts/clone-all-repos.sh <owner/org> [destination_dir]
-
.github/workflows/sync-repo.yml— Reusable workflow that syncs a repository/branch from one git platform to another. Can be triggered manually or called from other workflows. Supports cross-platform syncing (GitHub, GitLab, Bitbucket, etc.).Inputs:
Input Description Default source_hostSource git host (e.g., github.com)github.comsource_repoSource repository ( owner/repo)required source_branchBranch to sync from maintarget_hostTarget git host (e.g., gitlab.com)required target_repoTarget repository ( owner/repo)required target_branchBranch to push to same as source force_pushForce push to target trueSecrets:
Secret Description SOURCE_TOKENAccess token for source repository TARGET_TOKENAccess token for target repository (basic auth format) Note: When triggering manually, ensure
SOURCE_TOKENandTARGET_TOKENare configured as repository secrets.Usage from another workflow:
jobs: sync: uses: danielfbm/automation/.github/workflows/sync-repo.yml@main with: source_repo: "myorg/myrepo" target_host: "gitlab.com" target_repo: "myorg/myrepo" secrets: SOURCE_TOKEN: ${{ secrets.GITHUB_TOKEN }} TARGET_TOKEN: ${{ secrets.GITLAB_TOKEN }}
-
.github/workflows/sync-org.yml— Reusable workflow that syncs all repositories from a source organization to a target organization on another git platform. Lists all repos using the GitHub CLI and triggers the sync-repo workflow for each one.Inputs:
Input Description Default source_hostSource git host (e.g., github.com)github.comsource_orgSource organization/owner required source_branchBranch to sync from (applies to all repos) maintarget_hostTarget git host (e.g., gitlab.com)required target_orgTarget organization/owner required target_branchBranch to push to same as source force_pushForce push to target trueSecrets:
Secret Description SOURCE_TOKENAccess token for source repositories (needs org read access) TARGET_TOKENAccess token for target repositories (basic auth format) Note: When triggering manually, ensure
SOURCE_TOKENandTARGET_TOKENare configured as repository secrets. TheSOURCE_TOKENmust have permission to list repositories in the source organization.Usage from another workflow:
jobs: sync-org: uses: danielfbm/automation/.github/workflows/sync-org.yml@main with: source_org: "myorg" target_host: "gitlab.com" target_org: "myorg" secrets: SOURCE_TOKEN: ${{ secrets.GITHUB_TOKEN }} TARGET_TOKEN: ${{ secrets.GITLAB_TOKEN }}