Skip to content

Add a workflow checking links in plaintext and HTML files#634

Merged
seisman merged 3 commits intomasterfrom
check-links
Feb 22, 2021
Merged

Add a workflow checking links in plaintext and HTML files#634
seisman merged 3 commits intomasterfrom
check-links

Conversation

@seisman
Copy link
Member

@seisman seisman commented Sep 27, 2020

Description of proposed changes

This PR adds a workflow to check external links in plaintext and HTML files, using action https://github.com/lycheeverse/lychee-action.

  • External links in the ReST, Markdown and Python files in the master branch are checked
  • External links in the dev documentation (https://www.pygmt.org/dev/) are checked
  • Internal links are NOT checked, but when we build the documentation, we should see the warnings if internal links are broken.
  • Links to PRs and issues are excluded, because they are unlikely to be broken
  • The workflow runs weekly. If broken links (404) are detected, it will report an issue (see Link Checker Report #927 for an example, in which I added a broken link https://www.pygmt.org/abc/def for testing).

FYI, the workflow takes 50 seconds to check >1000 links. See the workflow runs in https://github.com/GenericMappingTools/pygmt/runs/1931775335?check_suite_focus=true.

Fixes #535

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

@vercel vercel bot temporarily deployed to Preview September 27, 2020 21:08 Inactive
@vercel vercel bot temporarily deployed to Preview September 27, 2020 21:18 Inactive
@weiji14 weiji14 added the maintenance Boring but important stuff for the core devs label Oct 2, 2020
@seisman seisman changed the title Add a workflow checking links in markdown and HTML files Add a workflow checking links in plaintext and HTML files Feb 18, 2021
@seisman seisman force-pushed the check-links branch 2 times, most recently from a9384e1 to b344db5 Compare February 19, 2021 00:44
@seisman seisman marked this pull request as ready for review February 19, 2021 00:48
@seisman seisman marked this pull request as draft February 19, 2021 00:51
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't checked too closely but I trust your Github Actions skills 😄 Only one minor comment but you can ignore it if it's too much work to do.

- name: Create Issue From File
uses: peter-evans/create-issue-from-file@v2.3.2
with:
title: Link Checker Report
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a unique Issue title (e.g. "Link Checker Report on 28 Feb 2021"), but not essential.

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

Labels

maintenance Boring but important stuff for the core devs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check broken links in the documentation

2 participants