Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Feb 22, 2021

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 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
@seisman seisman marked this pull request as ready for review February 19, 2021 00:57
@seisman seisman added this to the 0.3.1 milestone Feb 19, 2021
@seisman seisman requested review from a team February 19, 2021 00:57
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.

@seisman seisman merged commit 5d2b34f into master Feb 22, 2021
@seisman seisman deleted the check-links branch February 22, 2021 03:27
@core-man core-man mentioned this pull request Mar 7, 2021
8 tasks
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
…pingTools#634)

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

- External links in the ReST, Markdown and Python files in the master branch are checked
- External links in the dev documentation (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 GenericMappingTools#927 for an example, in which I added a broken link pygmt.org/abc/def 
for testing).
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