Skip to content

Latest commit

 

History

History
59 lines (48 loc) · 1.44 KB

stats-collection.md

File metadata and controls

59 lines (48 loc) · 1.44 KB

Preconditions

  • Install gh
  • Log in to GitHub:
gh auth login

Some 🆒 Commands

Org level

  • List all veraison repositories:
gh api /orgs/veraison/repos -q '.[].name'
  • List only public veraison repositories:
gh api /orgs/veraison/repos -q '.[] | select( any(.; .visibility == "public") ) | .name'
  • List veraison repositories with some interesting metadata:
gh api /orgs/veraison/repos --paginate --template '{{range .}}{{.name}}
  license: {{ if ( and .license .license.spdx_id ) }} {{.license.spdx_id}} {{else}}UNSET{{end}}
  stars: {{.stargazers_count}}
  watchers: {{.watchers_count}}
  visibility: {{.visibility}}
{{end}}'

Repo level

  • List contributors for the "services" repo:
gh api /repos/veraison/services/contributors --jq '[ .[].login ]'
  • Extract some interesting metadata about the "services" repo:
gh api /repos/veraison/services --template '{{.full_name}}
  language: {{.language}}
  license: {{.license.spdx_id}}
  forks: {{.forks}}
  watchers: {{.watchers}}
  stars: {{.stargazers_count}}
'
  • List PRs to the "services" repo that have been merged after a certain date:
gh pr list -R veraison/services --search "merged:>=2023-06-01" --limit 100
  • List issues of the "services" repo that have been closed after a certain date:
gh issue list -R veraison/services --search "closed:>=2023-06-01" --limit 100