github / pages-gem

A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages
http://pages.github.com
MIT License
1.82k stars 349 forks source link

Consider adding `webrick` to the whitelist of allowed GitHub Pages dependencies to avoid build warnings #887

Open daattali opened 1 year ago

daattali commented 1 year ago

There are a few issues regarding updating the documentation around webrick not being available in Ruby 3, but this issue is about a different problem.

If I want to support local builds, I must manually add webrick to the Gemfile. However, because of a recent change in jekyll-build-pages, this now results in a warning "github-pages can't satisfy your Gemfile's dependencies" for every build. This means that anyone who wants to host a GitHub Pages repo that uses the default jekyll builder, and also wants to be able to run locally, will always have to see a warning on every GitHub Actions build.

I don't know the security implications of allowing webrick in GitHub Pages, but I hope it can be done. If not, perhaps we should be able to remove that warning message somehow.

ohadschn commented 10 months ago

I believe there is a simple workaround, in your Gemfile:

install_if -> { ENV["GITHUB_ACTIONS"] != "true" } do
    puts "Is GitHub action: #{ENV["GITHUB_ACTIONS"] == "true"}"
    gem "webrick", "~> 1.8"
end 
janbrasna commented 1 week ago

No workaround should be needed since v232.