🌐 Website Issue | GitHub Repo Info Missing on Production Build #2232

Open
opened 2021-03-14 08:13:12 +00:00 by thatrobotdev · 2 comments
thatrobotdev commented 2021-03-14 08:13:12 +00:00 (Migrated from github.com)

Description

Builds are failing in Netlify when building a production build with jekyll (JEKYLL_ENV=production bundle exec jekyll build). This is because the GitHub Metadata plugin requires a repository to be set (https://github.com/jekyll/github-metadata/blob/master/docs/configuration.md).

This causes local builds to succeed and production builds to fail (like https://app.netlify.com/sites/privacytools-io/deploys/604d1c4b235d000008111252).

To fix this, from the GitHub Metadata docs:

In order for jekyll-github-metadata to know what metadata to fetch it must
be able to determine the repository NWO (name with owner, e.g. jekyll/jekyll-github-metadata) to ask GitHub about.

The easiest way to accomplish this is by setting an "origin" remote with a
github.com URL. If you ran git clone from GitHub, this is almost 100% the
case & no further action is needed. If you run git remote -v in your
repository, you should see your repo's URL.

If you don't have a git remote available, you have two other options:

  1. Set the environment variable PAGES_REPO_NWO to your repository name
    with owner, e.g. "jekyll/github-metadata". This is useful if you don't
    want to commit your repository to your git history.
  2. Add your repository name with organization to your site's configuration
    in the repository key.
repository: username/repo-name

"NWO" stands for "name with owner." It is GitHub lingo for the username of
the owner of the repository plus a forward slash plus the name of the
repository, e.g. 'parkr/blog', where 'parkr' is the owner and 'blog' is the
repository name.

Your site.github.* fields should fill in like normal. If you run Jekyll
with the --verbose flag, you should be able to see all the API calls
made.

Screenshots

screenshot of netlify production build failure screenshot of local build failure
## Description Builds are failing in Netlify when building a production build with jekyll (`JEKYLL_ENV=production bundle exec jekyll build`). This is because the GitHub Metadata plugin requires a repository to be set (https://github.com/jekyll/github-metadata/blob/master/docs/configuration.md). This causes local builds to succeed and production builds to fail (like https://app.netlify.com/sites/privacytools-io/deploys/604d1c4b235d000008111252). To fix this, from the GitHub Metadata docs: > In order for jekyll-github-metadata to know what metadata to fetch it must > be able to determine the repository NWO (name with owner, e.g. `jekyll/jekyll-github-metadata`) to ask GitHub about. > > The easiest way to accomplish this is by setting an "origin" remote with a > github.com URL. If you ran `git clone` from GitHub, this is almost 100% the > case & no further action is needed. If you run `git remote -v` in your > repository, you should see your repo's URL. > > If you don't have a git remote available, you have two other options: > > 1. Set the environment variable `PAGES_REPO_NWO` to your repository name > with owner, e.g. `"jekyll/github-metadata"`. This is useful if you don't > want to commit your repository to your git history. > 2. Add your repository name with organization to your site's configuration > in the `repository` key. > > ```yaml > repository: username/repo-name > ``` > > "NWO" stands for "name with owner." It is GitHub lingo for the username of > the owner of the repository plus a forward slash plus the name of the > repository, e.g. 'parkr/blog', where 'parkr' is the owner and 'blog' is the > repository name. > > Your `site.github.*` fields should fill in like normal. If you run Jekyll > with the `--verbose` flag, you should be able to see all the API calls > made. ## Screenshots <img width="1156" alt="screenshot of netlify production build failure" src="https://user-images.githubusercontent.com/18013689/111061626-99aedc80-8461-11eb-9bb1-a4f9965f2bf2.png"> <img width="910" alt="screenshot of local build failure" src="https://user-images.githubusercontent.com/18013689/111061843-8a7c5e80-8462-11eb-9bc6-4b90342ae58a.png">
lrq3000 commented 2021-05-15 03:36:15 +00:00 (Migrated from github.com)

Could someone fix this please? All my builds failed and it was not trivial to understand why (because it could have been formatting errors). I can't provide a netlify URL for my PRs until this is resolved.

Could someone fix this please? All my builds failed and it was not trivial to understand why (because it could have been formatting errors). I can't provide a netlify URL for my PRs until this is resolved.
lrq3000 commented 2021-05-15 03:54:34 +00:00 (Migrated from github.com)

I fixed the issue in #2293 by adding a repository: privacytools/privacytools.io parameter in _config.yml. Merging this PR should fix the issue for all other PRs I guess.

I fixed the issue in #2293 by adding a `repository: privacytools/privacytools.io` parameter in `_config.yml`. Merging this PR should fix the issue for all other PRs I guess.
This repo is archived. You cannot comment on issues.
No Milestone
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: privacyguides/privacytools.io#2232
No description provided.