This script runs Reposaur against every repository in an organization, generating a report in report.json.
Run:
$ chmod +x script.sh
$ ./script.sh <ORGANIZATION>Replacing <ORGANIZATION> with the name of the organization you want to test.
| package repository | |
| # METADATA | |
| # title: Repository description is empty | |
| # description: > | |
| # The repository description is empty. Having a description is | |
| # important to help discoverability and other people to understand | |
| # the purpose of a repository. | |
| # custom: | |
| # tags: [guidelines, best-practices] | |
| warn_empty_description { | |
| input.description == null | |
| } |
| #!/usr/bin/env bash | |
| owner="$1" | |
| repos=$(gh api "/orgs/$owner/repos" --paginate) | |
| reports="" | |
| for row in $(echo "$repos" | jq -r '.[] | @base64'); do | |
| _repo() { | |
| echo ${row} | base64 -d | jq -r ${1} | |
| } | |
| # create report | |
| report=$(_repo '.' | reposaur -f json -p . | jq -c) | |
| # append report to global list | |
| reports="$reports {\"$(_repo '.name')\": $report}" | |
| done | |
| # combine reports in single object and write to report.json | |
| echo -E "$reports" | jq -s add > report.json |