Last active
November 3, 2020 22:03
-
-
Save thattommyhall/6c0a22eba96fc5876223d42d7973c0c4 to your computer and use it in GitHub Desktop.
find all repos in any org you have access to that have both workflows and secrets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "octokit" | |
client = Octokit::Client.new(:access_token => "SOMETHING") | |
client.orgs.each do |org| | |
org_name = org.login | |
client.org_repositories(org_name).each do |repo| | |
repo_name = repo.full_name | |
repo_workflows = client.workflows(repo_name) | |
if repo_workflows.total_count > 0 | |
secrets_response = client.list_secrets(repo_name) | |
if secrets_response.total_count > 0 | |
puts repo_name | |
puts "private: #{repo.private}" | |
puts secrets_response.secrets.map(&:name).join(", ") | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment