File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,10 @@ gh auth refresh -h github.com -s admin:org
316
316
317
317
Gets the SBOM for a repository.
318
318
319
+ ## get-search-results.sh
320
+
321
+ Uses the search API for code search.
322
+
319
323
## get-sso-enabled-pats.sh
320
324
321
325
Retrieves all SSO enabled PATs users have created for an organization.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # searches for results that have fakecompany.com AND (token or password) in the file
4
+
5
+ # note this api is likely to trip secondary rate limits for frequent queries
6
+
7
+ # the new code search via the UI is better https://github.com/search?q=fakecompany.com+AND+%28token+OR+password%29&type=code
8
+
9
+ results=$( gh api --paginate " /search/code?q=fakecompany.com+token+in:file&per_page=100" )
10
+ results+=$( gh api --paginate " /search/code?q=fakecompany.com+password+in:file&per_page=100" )
11
+
12
+ # remove duplicates
13
+ echo $results | jq ' .items[].html_url' | sort | uniq
You can’t perform that action at this time.
0 commit comments