diff --git a/README.md b/README.md index 0dd3254..3f76414 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ This is a work-in-progress. Currently the tool will report: - Repository disk sizes - Pull request counts - Comment counts +- If repository is archived +- If repository is public Tested on BitBucket Server 8.6.1 diff --git a/main.go b/main.go index 78d4083..e05246c 100644 --- a/main.go +++ b/main.go @@ -383,7 +383,7 @@ func Process(cmd *cobra.Command, args []string) (err error) { // write header _, err = out_file.WriteString( - fmt.Sprintln("project,repository,size,pull_requests,comments"), + fmt.Sprintln("project,repository,size,pull_requests,comments,archived,public"), ) if err != nil { OutputError("Error writing to output file.", true) @@ -393,12 +393,14 @@ func Process(cmd *cobra.Command, args []string) (err error) { _, err = out_file.WriteString( fmt.Sprintln( fmt.Sprintf( - "%s,%s,%d,%d,%d", + "%s,%s,%d,%d,%d,%s,%s", repository.Project.Key, repository.Slug, repository.Size.Repository, len(repository.PullRequests), repository.CommentCount, + strconv.FormatBool(repository.Archived), + strconv.FormatBool(repository.Public), ), ), ) @@ -558,7 +560,7 @@ func BBSHTTPRequest(path string, endpoint string, method string) (data string, e url := fmt.Sprintf("%s%s%s", bbs_server_url, path, endpoint) Debug(fmt.Sprintf("Request URL: %s", url)) - // set SSL verification using inverse bool from flag + // set SSL verification tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: no_ssl_verify}, }