github / github/pages-gem

Broken links on travis-ci because of missing github metadata: GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.

Open
#626 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
1.9k
Forks
360
PR merge metrics
No merged PRs in 30d

Description

### Before submitting an issue, please be sure to

- [x] Read [the contributing instructions](https://github.com/github/pages-gem/blob/master/docs/CONTRIBUTING.md#contributing-to-the-github-pages-gem)
- [x] Update to the latest Gem version (run `bundle update github-pages`)

### This issue affects

- [ ] The site generated by GitHub Pages
- [x] Building sites locally

*The GitHub Pages Gem is intended to help users replicate the GitHub Pages build environment locally. If your issue affects both the hosted version and the version previewed locally, you may be better suited reporting [seeking support in other forums](https://github.com/github/pages-gem/blob/master/docs/SUPPORT.md).*

### What did you do (e.g., steps to reproduce)

I set up my [personal site](https://github.com/dleidert/dleidert.github.io) to be built using travis-ci.org. If I use this Gemfile:

```
source 'https://rubygems.org'

gem "github-pages"
gem "jekyll"

platforms :ruby_21 do
gem "rb-inotify", "~> 0.9"
gem "nokogiri", "~> 1.9"
end

group :jekyll_plugins do
gem "jekyll-feed"
gem "jekyll-paginate"
gem "jekyll-redirect-from"
gem "jekyll-seo-tag"
gem "jekyll-sitemap"
end

group :test do
gem "html-proofer"
end
```

everything works fine. But if I try to use a short version as suggested by the github-pages gem documentation:

```
source 'https://rubygems.org'

gem "github-pages", group: :jekyll_plugins

platforms :ruby_21 do
gem "rb-inotify", "~> 0.9"
gem "nokogiri", "~> 1.9"
end

group :test do
gem "html-proofer"
end
```

The build throws a warning:

```
GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
```

and `html-proofer` fails with a lot of broken links like this:

```
- ./_site/2019/02/22/bde-lock.html
* External link https://github.com/pages/dleidert/2019/02/22/bde-lock.html failed: 404 No error
* internally linking to /pages/dleidert/, which does not exist (line 25)
Daniels user page
```

Digging around I found a few hints (e.g. in #399), that I should add this

```
github: [metadata]
repository: dleidert/dleidert.github.io
```

to my `_config.yml` and did it. But it still fails. It is missing essential metadata. But I cannot figure out, what is making the difference here. With the first Gemfile variant, I don't need to add anything to my `_config.yml` and everything works as expected. Further in both Ruby 2.5 environments the same jekyll* and *github* gems are installed with the same version. I cannot find a difference here. ~~In other environments like 2.1 the gem list is quite different!~~

### What did you expect to happen?

I expect, that the pages are built and checked successfully using either of the Gemfiles quoted above.

### What happened instead?

The build produces output with broken links because of missing github metadata and leads to errors using a html checker tool like `html-proofer`

### Additional information

* Link to the live site (if applicable):

[Succeeding build](https://travis-ci.org/dleidert/dleidert.github.io/builds/501112608) including a [raw log](https://api.travis-ci.org/v3/job/501112612/log.txt)

[Failing build](https://travis-ci.org/dleidert/dleidert.github.io/builds/501119863) including a [raw log](https://api.travis-ci.org/v3/job/501119867/log.txt)

* Link to the source repo (if applicable):

Working configuration in the master branch:

Non-working configuration in the github-pages-gem branch:
https://github.com/dleidert/dleidert.github.io/tree/github-pages-gem

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.