8000 Enable support for `topics` property (#166) · jekyll/github-metadata@97cbc46 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97cbc46

Browse files
cmbuckleyjekyllbot
authored andcommitted
Enable support for topics property (#166)
Merge pull request 166
1 parent 3011f0c commit 97cbc46

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

lib/jekyll-github-metadata/repository.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ def organization_repository?
107107
end
108108

109109
def owner_public_repositories
110-
memoize_value :@owner_public_repositories, Value.new("owner_public_repositories", proc { |c| c.list_repos(owner, "type" => "public") })
110+
options = {
111+
:type => "public",
112+
:accept => "application/vnd.github.mercy-preview+json",
113+
}
114+
memoize_value :@owner_public_repositories, Value.new("owner_public_repositories", proc { |c| c.list_repos(owner, options) })
111115
end
112116

113117
def organization_public_members

script/webmock-repopulate

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
curl_me() {
66
(set -x; curl \
77
-H "Authorization: token $GITHUB_TOKEN" \
8-
-H "Accept: application/vnd.github.v3+json" \
8+
-H "Accept: application/vnd.github.${3:-v3}+json" \
99
-H "Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3" \
1010
-H "Content-Type: application/json" \
1111
-H "User-Agent: Octokit Ruby Gem 4.2.0" \
@@ -18,6 +18,6 @@ curl_me "/repos/jekyll/github-metadata/contributors?per_page=100" "repo_contribu
1818
curl_me "/repos/jekyll/github-metadata/releases?per_page=100" "repo_releases"
1919
curl_me "/orgs/jekyll" "org"
2020
curl_me "/orgs/jekyll/public_members" "org_members"
21-
curl_me "/users/jekyll/repos?per_page=100&type=public" "owner_repos"
21+
curl_me "/users/jekyll/repos?per_page=100&type=public" "owner_repos" "mercy-preview"
2222
curl_me "/repos/jekyll/github-metadata/pages" "repo_pages"
2323
curl_me "/repos/jekyll/github-metadata/releases/latest" "latest_release"

spec/spec_helpers/web_mock_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module WebMockHelper
44
REQUEST_HEADERS = {
5-
"Accept" => %r!application/vnd\.github\.(v3|drax-preview)\+json!,
5+
"Accept" => %r!application/vnd\.github\.(v3|drax-preview|mercy-preview)\+json!,
66
"Accept-Encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3",
77
"Content-Type" => "application/json",
88
"User-Agent" => "Octokit Ruby Gem #{Octokit::VERSION}",

0 commit comments

Comments
 (0)
0