Skip to content

Commit

Permalink
adds skip teams flag to byRepos cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
amenocal committed Oct 28, 2024
1 parent c17b910 commit 2b8aa0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/byRepos.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var byReposCmd = &cobra.Command{
mappingFile := cmd.Flag("mapping-file").Value.String()
ghHostname := cmd.Flag("source-hostname").Value.String()
repoFile := cmd.Flag("from-file").Value.String()
skipTeams := cmd.Flag("skip-teams").Value.String()

// Set ENV variables
os.Setenv("GHMT_TARGET_ORGANIZATION", targetOrganization)
Expand All @@ -37,6 +38,7 @@ var byReposCmd = &cobra.Command{
os.Setenv("GHMT_MAPPING_FILE", mappingFile)
os.Setenv("GHMT_SOURCE_HOSTNAME", ghHostname)
os.Setenv("GHMT_REPO_FILE", repoFile)
os.Setenv("GHMT_SKIP_TEAMS", skipTeams)

// Bind ENV variables in Viper
viper.BindEnv("TARGET_ORGANIZATION")
Expand Down Expand Up @@ -73,5 +75,7 @@ func init() {

byReposCmd.Flags().StringP("mapping-file", "m", "", "Mapping file path to use for mapping teams members handles")

byReposCmd.Flags().BoolP("skip-teams", "k", false, "Skips adding members and repos to teams that already exist to save on API requests (default \"false\")")

byReposCmd.Flags().StringP("source-hostname", "u", os.Getenv("SOURCE_HOST"), "GitHub Enterprise source hostname url (optional) Ex. https://github.example.com")
}

0 comments on commit 2b8aa0e

Please sign in to comment.