build: added `--admin` flag
diff --git a/cmd/atmosphere-ci/image_repo_sync.go b/cmd/atmosphere-ci/image_repo_sync.go
index e4f9667..4a3f608 100644
--- a/cmd/atmosphere-ci/image_repo_sync.go
+++ b/cmd/atmosphere-ci/image_repo_sync.go
@@ -9,6 +9,8 @@
)
var (
+ admin bool
+
imageRepoSyncCmd = &cobra.Command{
Use: "sync [project]",
Short: "Sync image repository",
@@ -18,6 +20,11 @@
ctx := context.TODO()
repo := image_repositories.NewImageRepository(args[0])
+
+ if admin {
+ repo.UpdateGithubConfiguration(ctx)
+ }
+
err := repo.Synchronize(ctx)
if err != nil {
log.Panic(err)
@@ -27,5 +34,7 @@
)
func init() {
+ imageRepoCmd.PersistentFlags().BoolVar(&admin, "admin", false, "Run using admin PAT (will update repo configs)")
+
imageRepoCmd.AddCommand(imageRepoSyncCmd)
}