Skip to content

Commit

Permalink
Use [linkspector](https://github.com/UmbrellaDocs/linkspector) to che…
Browse files Browse the repository at this point in the history
…ck links (#148)

## Description

Use [linkspector](https://github.com/UmbrellaDocs/linkspector) to check
links

## Changes Made

* Use linkspector to check links
* Update defaults

## Related Issues

Fixes #131

## Checklist

- [x] I have used a PR title that is descriptive enough for a release
note.
- [x] I have tested these changes locally.
- [x] I have added appropriate tests or updated existing tests.
- [ ] I have tested these changes on a cluster [name of the cluster] /
customer [name of the customer]
- [ ] I have added appropriate documentation or updated existing
documentation.

---------

Co-authored-by: cosimomeli <[email protected]>
  • Loading branch information
chicco785 and cosimomeli authored Dec 18, 2024
1 parent 0a92a13 commit f8850fa
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 19 deletions.
14 changes: 14 additions & 0 deletions .github/config/.linkspector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://github.com/UmbrellaDocs/linkspector?tab=readme-ov-file#configuration
dirs:
- .
useGitIgnore: true
aliveStatusCodes:
- 200
- 201
- 204
- 206
- 429
ignorePatterns:
- pattern: '^https://localhost'
- pattern: '^https://github.com/orgs/zaphiro-technologies/'
- pattern: '^https://github.com/zaphiro-technologies/'
53 changes: 35 additions & 18 deletions .github/workflows/markdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:
type: boolean
config-links-path:
required: false
default: '.github/config/md-link-config.json'
default: '.github/config/.linkspector.yml'
type: string
config-lint-path:
default: '.github/config/.markdownlint.json'
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
scripts:
- '.github/config/.markdownlint.json'
- '.github/config/.prettierignore'
- '.github/config/md-link-config.json'
- '.github/config/.linkspector.yml'
- '.gramma.json'
- '.grammarignore'
- 'grammar-check.sh'
Expand Down Expand Up @@ -108,23 +108,40 @@ jobs:
git config --global user.email '[email protected]'
git commit -am "Automated markdown-lint fixes [dependabot skip]" || echo "No changes to commit"
git push
shopt -s globstar
rm -fr vendor
rm -fr */vendor
# Checks the status of hyperlinks in .md and .MD files in verbose mode (the action is case sensitive and .{MD,md})
- name: Check links (.md)
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: ${{ inputs.config-link-path || '.github/config/md-link-config.json' }}
use-verbose-mode: 'yes'
use-quiet-mode: 'yes'
- name: Check links (.MD)
uses: gaurav-nelson/github-action-markdown-link-check@v1
- name: Fix apparmor issue for puppeteer
run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
- name: Default configuration for link checker
run: |
FILE=${{ inputs.config-link-path || '.github/config/.linkspector.yml' }}
if [ -f $FILE ]; then
echo "'$FILE' Exists"
else
# Write content to the file
cat <<EOF > "$FILE"
dirs:
- .
excludedDirs:
- vendor
useGitIgnore: true
aliveStatusCodes:
- 200
- 201
- 204
- 206
- 429
ignorePatterns:
- pattern: '^http(s?)://localhost'
- pattern: '^https://github.com/orgs/zaphiro-technologies/'
- pattern: '^https://github.com/zaphiro-technologies/'
EOF
fi
- name: Check links
uses: umbrelladocs/action-linkspector@v1
with:
config-file: ${{ inputs.config-link-path || '.github/config/md-link-config.json' }}
use-verbose-mode: 'yes'
use-quiet-mode: 'yes'
file-extension: '.MD'
filter_mode: nofilter
reporter: github-pr-review
config_file: ${{ inputs.config-link-path || '.github/config/.linkspector.yml' }}
fail_on_error: true
markdown-spellchecker:
runs-on: ubuntu-latest
needs: changes
Expand Down
4 changes: 3 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# GitHub Workflows Release Notes

## 0.0.3-dev - 2024-12-16
## 0.0.3-dev - 2024-12-18

### Features

- Use [linkspector](https://github.com/UmbrellaDocs/linkspector) to check links
(PR #148 by @chicco785)
- docker workflow: add javascript mode for cache (PR #146 by @chicco785)
- Add workflow to create a new release (PR #145 by @chicco785)
- golang workflow: include `.sql` and `.docker/*.yml` files in golang changes
Expand Down

0 comments on commit f8850fa

Please sign in to comment.