Skip to content

Commit a6f6329

Browse files
committed
Add link checker
1 parent ea0240b commit a6f6329

5 files changed

Lines changed: 45 additions & 5 deletions

File tree

.github/workflows/docs-links.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Docs / Links"
2+
# For more information,
3+
# see https://sphinx-theme.scylladb.com/stable/deployment/production.html#available-workflows
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: "0 0 * * 0" # At 00:00 on Sunday
9+
10+
jobs:
11+
linkChecker:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
persist-credentials: false
18+
fetch-depth: 0
19+
20+
- name: Link Checker
21+
id: lychee
22+
uses: lycheeverse/[email protected]
23+
with:
24+
args: --verbose --no-progress './**/*.md' './**/*.rst'
25+
env:
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
27+
28+
- name: Create Issue From File
29+
if: ${{ steps.lychee.outputs.exit_code != 0 }}
30+
uses: peter-evans/create-issue-from-file@v3
31+
with:
32+
title: Link Checker Report
33+
content-filepath: ./lychee/out.md
34+
labels: report, automated issue

.lycheeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
http://0.0.0.0:5500
2+
http://127.0.0.1:5500
3+
https://scylladb.github.io

docs/source/deployment/production.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ The toolchain provides the following workflows under the directory ``.github/wor
2828
- Builds multi versioned docs every time the default branch (e.g. ``master``) receives an update. If the build completes successfully, the workflow publishes the HTML version to GitHub Pages.
2929
* - ``docs-pr.yaml``
3030
- Builds the docs when the default branch receives a new pull request or when the pull request receives new commits. The purpose of this workflow is to make sure pull requests do not break the default branch after being merged.
31+
* - ``docs-links.yaml``
32+
- Looks for broken links once a week. If there are broken links, it creates an issue in the same repository with the list of affected links.
3133

3234
.. caution:: If you modify these workflows in your repository, you will need to maintain the changes. So instead, we recommend you to open an issue in the `sphinx-scylladb-theme repository <https://github.com/scylladb/sphinx-scylladb-theme>`_ so that all projects can benefit from the improvements you made.
3335

@@ -43,8 +45,9 @@ To install the workflows:
4345
project-name/
4446
├── .github/
4547
| ├── workflows/
46-
| | ├── [email protected]
47-
| | ├── [email protected]
48+
| | ├── docs-pages.yaml
49+
| | ├── docs-pr.yaml
50+
| | ├── docs-links.yaml
4851
4952
#. If the default branch is not ``master`` or the docs are not under the ``docs`` folder, the workflows to match the project configuration. For example:
5053

docs/source/examples/links.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ There are a few links you can use with different purposes.
1414
* - External Link
1515
- .. code-block:: rst
1616

17-
`External Link <https://docs.scylladb.com/some-doc>`_
18-
- `External Link <https://docs.scylladb.com/some-doc>`_
17+
`External Link <https://docs.scylladb.com/>`_
18+
- `External Link <https://docs.scylladb.com/>`_
1919
- Use this markup to create a link to another site or project. When rendered it has an arrow pointing out icon. It opens the content in a new tab.
2020
* - Internal Cross-reference
2121
- .. code-block:: rst

docs/source/upgrade/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7070
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): The promo banner now supports icons with the option theme option `banner_icon_path`. For more information, see [Template Options](https://sphinx-theme.scylladb.com/stable/configuration/template.html).
7171
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): The contribute button adds the option "Edit on GitHub". To configure your project to support this option, read [Template Options](https://sphinx-theme.scylladb.com/stable/configuration/template.html).
7272
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): We run hooks on every commit to automatically point out linting issues.
73-
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): The new workflow `docs-pr` runs on pull requests to make sure docs build without warnings before being merged. For more information, see [Deployment](https://sphinx-theme.scylladb.com/stable/deployment/production.html).
73+
- [#201](https://github.com/scylladb/sphinx-scylladb-theme/pull/201): The new workflow `docs-pr` runs on pull requests to make sure docs build without warnings before being merged. For more information, see [Deployment](https://sphinx-theme.scylladb.com/branch-1.0/github-pages.html).
7474

7575
### Changed
7676

0 commit comments

Comments
 (0)