-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add GitHub workflows for Markdown links checking
Two GitHub workflows have been added that perform Markdown links checking: * .github/workflows/markdown-link-check-pr.yaml: Executed in each PR. * .github/workflos/markdown-link-check-weekly.yaml: Executed Weekly on Mondays at 07:00 UTC. All the specified md files and directories in the workflows are intentionally checked, independently on whether they have been modified or not. The reason for this is that even if a given .md file has not been modified, its links can become broken. For example, if a PR moves .md files from directories and some other .md files contain relative links referencing the old path of the moved files, then the links become broken even though the file containing the references not being modified.
- Loading branch information
1 parent
0880be9
commit 4acfe07
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: PR check Markdown links | ||
|
||
# Only run this workflow on PRs | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
# Disable permissions for all available scopes for the GITHUB_TOKEN | ||
# except for the metadata scope. | ||
permissions: {} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pr-markdown-link-check: | ||
# Only run the job on non-draft PRs | ||
if: "github.event.pull_request.draft == false" | ||
name: Check PR Markdown links | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code under the $GITHUB_WORKSPACE directory | ||
uses: actions/checkout@v3 | ||
- name: Check markdown links | ||
uses: gaurav-nelson/[email protected] | ||
with: | ||
use-quiet-mode: 'no' | ||
use-verbose-mode: 'yes' | ||
config-file: './.markdown-link-check/markdown-link-check-config.json' | ||
check-modified-files-only: 'no' | ||
file-extension: '.md' | ||
# Unfortunately there's currently not a way to ignore specific | ||
# directories/paths in the GitHub action so we need to specify | ||
# the desired set of directories/paths that we want to check | ||
# in order to avoid checking undesired directories/paths | ||
folder-path: './docs, ./pkg, ./templates, ./.github, ./cmd, ./internal, ./openapi, ./docker, ./scripts' | ||
file-path: './README.md, ./CONTRIBUTING.md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Weekly check Markdown links | ||
|
||
# Run this workflow every Monday at 07:00 UTC | ||
on: | ||
schedule: | ||
- cron: "0 7 * * 1" | ||
|
||
# Disable permissions for all available scopes for the GITHUB_TOKEN | ||
# except for the metadata scope. | ||
permissions: {} | ||
|
||
jobs: | ||
weekly-markdown-link-check: | ||
name: Weekly Check Markdown links | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code under the $GITHUB_WORKSPACE directory | ||
uses: actions/checkout@v3 | ||
- name: Check markdown links | ||
uses: gaurav-nelson/[email protected] | ||
with: | ||
use-quiet-mode: 'no' | ||
use-verbose-mode: 'yes' | ||
config-file: './.markdown-link-check/markdown-link-check-config.json' | ||
check-modified-files-only: 'no' | ||
file-extension: '.md' | ||
# Unfortunately there's currently not a way to ignore specific | ||
# directories/paths in the GitHub action so we need to specify | ||
# the desired set of directories/paths that we want to check | ||
# in order to avoid checking undesired directories/paths | ||
folder-path: './docs, ./pkg, ./templates, ./.github, ./cmd, ./internal, ./openapi, ./docker, ./scripts' | ||
file-path: './README.md, ./CONTRIBUTING.md' |