Categorygithub.com/xbglowx/github-org-repos-sync
modulepackage
0.0.3
Repository: https://github.com/xbglowx/github-org-repos-sync.git
Documentation: pkg.go.dev

# README

github-org-repos-sync Build and Test golangci-lint CodeQL

Sync GitHub organization repos

Build

  1. git clone [email protected]:xbglowx/github-org-repos-sync.git
  2. go get -d .
  3. go build .

Auth

  1. Authenticated access to the GitHub API via personal access token with scope repo
    • export GITHUB_TOKEN=<token>
  2. git cli authenticated to GitHub

How It Works

  1. Generates a list of repos the caller has access to within the specified organization
  2. Clones each repo if it doesn't exist locally in the destionation path
  3. If the repo already exists:
    1. Switches to the default branch, only if the current branch is clean; Stashes if dirty
    2. Updates

Usage

  1. ./github-org-repos-sync --help

# Packages

Copyright © 2021 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.