Skip to content

Add external links to docs#4

Open
github-learning-lab[bot] wants to merge 8 commits into
mainfrom
add-links
Open

Add external links to docs#4
github-learning-lab[bot] wants to merge 8 commits into
mainfrom
add-links

Conversation

@github-learning-lab

Copy link
Copy Markdown
Contributor

With the addition of links to our code base, we should add a unit test as one of our Travis CI jobs that run whenever it builds. Let's add a test using HTMLProofer to test for any broken links, images, or HTML.

We'll now add the HTMLProofer test, but we'll also refactor some of the commands away from the config file into standalone test scripts.

Step 8: Apply batch suggested fixes to refactor config

Let's make sure all links are valid by adding a link checker unit test, and packaging into test scripts.

⌨️ Activity: Check for broken links using Travis CI

  1. Go to the Files changed tab.
  2. Next to each suggested change, click Add suggestion to batch.
  3. At the top of the page, click Commit suggestions and enter a commit message.
  4. Click Commit changes.

I'll respond below with your next step.

Comment thread .travis.yml Outdated
Comment thread .travis.yml Outdated
Comment thread .travis.yml Outdated
Comment thread .travis.yml Outdated
@github-learning-lab github-learning-lab Bot mentioned this pull request Mar 12, 2021
aJeide and others added 2 commits March 12, 2021 12:51
make sure all links are valid by adding a link checker

Co-authored-by: github-learning-lab[bot] <37936606+github-learning-lab[bot]@users.noreply.github.com>
@github-learning-lab

Copy link
Copy Markdown
Contributor Author

Nice work! We've added a unit test to check for broken links. When a broken link was committed to our pull request, the test caught it and let us know the build had failed.

Clicking on the Details link next to one of our statuses shows the following:

screen shot 2019-01-03 at 1 17 26 pm

Notice how the two stages build and testlinks both show as Travis CI jobs in our build. Also, notice that even though the build test succeeds, we are blocked from merging because our branch protection requires all jobs to pass in our build before merging.

screen shot 2019-01-03 at 12 30 31 pm

Step 9: Fix the broken link

To get our checks to pass, let's fix the broken link so both Travis CI checks are passing. You can click on the Details link next to the failed testlinks Travis CI test for more information. By doing so, you'll find the following error:

External link https://help.github.com/setupgit failed: 404 No error

⌨️ Activity: Fix the broken link

  1. In this pull request, change https://help.github.com/setupgit to https://help.github.com/articles/set-up-git/. You can do this by editing the file from the Files changed tab, or by scrolling down and accepting the suggested change.

I'll respond below with your next step.

Comment thread index.md Outdated
Co-authored-by: github-learning-lab[bot] <37936606+github-learning-lab[bot]@users.noreply.github.com>
@github-learning-lab github-learning-lab Bot requested a review from aJeide March 12, 2021 19:53
@github-learning-lab

Copy link
Copy Markdown
Contributor Author

Nice work!

It might take a moment, but once both the build and testlinks tests are passing, it's time to merge this pull request.

Step 10: Merge the unit test

⌨️ Activity: Add the testlinks unit test to main

  1. Review and approve this pull request.
  2. Click Merge pull request, and delete your branch.

I'll respond below with your next step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants