Skip to content

Commit 4b7c2a5

Browse files
committed
docs: disable gh-metadata network for development builds
Disable GitHub metadata queries for development builds to prevent hammering the GitHub API and causing possible build failures because of abuse detection. Need to update jekyll-github-metadata to an unreleased version to support this.
1 parent ebbeea4 commit 4b7c2a5

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ JEKYLL_ENV ?= development
2121
SITE_BUILD_CMD := $(CONTAINER_RUN_CMD) --rm -i -u "`id -u`:`id -g`" \
2222
$(shell [ -t 0 ] && echo '-t') \
2323
-e JEKYLL_ENV=$(JEKYLL_ENV) \
24+
$(shell [ "$(JEKYLL_ENV)" = "development" ] && echo '-e PAGES_DISABLE_NETWORK=1') \
2425
--volume="$$PWD/docs:/work" \
2526
--volume="$$PWD/docs/vendor/bundle:/usr/local/bundle" \
2627
-w /work \

docs/Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ gem "jekyll", "~> 3.10.0"
1919
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
2020
# uncomment the line below. To upgrade, run `bundle update github-pages`.
2121
gem "github-pages", "~> 232", group: :jekyll_plugins
22+
gem "jekyll-github-metadata", git: "https://github.com/jekyll/github-metadata", ref: "e41276ff417a4aa4701bd617b5007c07e1e074e6", group: :jekyll_plugins
2223

2324
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
2425
# and associated library.

docs/Gemfile.lock

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
GIT
2+
remote: https://github.com/jekyll/github-metadata
3+
revision: e41276ff417a4aa4701bd617b5007c07e1e074e6
4+
ref: e41276ff417a4aa4701bd617b5007c07e1e074e6
5+
specs:
6+
jekyll-github-metadata (2.16.1)
7+
jekyll (>= 3.4, < 5.0)
8+
octokit (>= 4, < 7, != 4.4.0)
9+
110
GEM
211
remote: https://rubygems.org/
312
specs:
@@ -140,9 +149,6 @@ GEM
140149
jekyll (>= 3.7, < 5.0)
141150
jekyll-gist (1.5.0)
142151
octokit (~> 4.2)
143-
jekyll-github-metadata (2.16.1)
144-
jekyll (>= 3.4, < 5.0)
145-
octokit (>= 4, < 7, != 4.4.0)
146152
jekyll-include-cache (0.2.1)
147153
jekyll (>= 3.7, < 5.0)
148154
jekyll-mentions (1.6.0)
@@ -218,7 +224,7 @@ GEM
218224
gemoji (>= 3, < 5)
219225
html-pipeline (~> 2.2)
220226
jekyll (>= 3.0, < 5.0)
221-
json (2.12.0)
227+
json (2.12.2)
222228
kramdown (2.4.0)
223229
rexml
224230
kramdown-parser-gfm (1.1.0)
@@ -283,6 +289,7 @@ PLATFORMS
283289
DEPENDENCIES
284290
github-pages (~> 232)
285291
jekyll (~> 3.10.0)
292+
jekyll-github-metadata!
286293
jekyll-rtd-theme (~> 2.0, >= 2.0.10)
287294
tzinfo (~> 2.0)
288295
tzinfo-data

netlify.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
[build]
33
command = "cd docs/ && source /opt/buildhome/.rvm/scripts/rvm && rvm install ruby-3.3.8 && bundle plugin install bundler-override && bundle install && jekyll build"
44
publish = "docs/_site/"
5+
6+
[build.environment]
7+
PAGES_DISABLE_NETWORK = "1"

0 commit comments

Comments
 (0)