Browse Source

added alias "curl-github-api"

Fabian Peter Hammerle 3 years ago
parent
commit
beacd918ab
1 changed files with 2 additions and 0 deletions
  1. 2 0
      gitconfig

+ 2 - 0
gitconfig

@@ -74,6 +74,8 @@
 [alias]
 	a = add
 	c = commit
+	# git curl-github-api /commits/master/statuses | jq '.[].state'
+	curl-github-api = "!f() { path="$1"; shift; git github-repo-names | xargs -I{} --verbose curl --header 'Accept: application/vnd.github.v3+json' 'https://api.github.com/repos/{}'\"$path\" "$@"; }; f"
 	d = diff
 	f = fetch --prune
 	github-repo-names = !git github-urls | grep --only-matching --perl-regexp 'github.com/\\K.+(?=\\.git)'