Skip to content

Commit

Permalink
Add archived and public statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
samueljmello committed May 18, 2023
1 parent 670e0fa commit e67586e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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),
),
),
)
Expand Down Expand Up @@ -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},
}
Expand Down

0 comments on commit e67586e

Please sign in to comment.