From f8850fab4ddd171ffb4ca8cddd70c626dd4d1f00 Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Wed, 18 Dec 2024 10:08:08 +0100 Subject: [PATCH] Use [linkspector](https://github.com/UmbrellaDocs/linkspector) to check 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 --- .github/config/.linkspector.yml | 14 +++++++++ .github/workflows/markdown.yaml | 53 ++++++++++++++++++++++----------- RELEASE_NOTES.md | 4 ++- 3 files changed, 52 insertions(+), 19 deletions(-) create mode 100644 .github/config/.linkspector.yml diff --git a/.github/config/.linkspector.yml b/.github/config/.linkspector.yml new file mode 100644 index 0000000..3af9edd --- /dev/null +++ b/.github/config/.linkspector.yml @@ -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/' \ No newline at end of file diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml index 3e81991..b4671b8 100644 --- a/.github/workflows/markdown.yaml +++ b/.github/workflows/markdown.yaml @@ -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' @@ -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' @@ -108,23 +108,40 @@ jobs: git config --global user.email 'bot@zaphiro.ch' 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 < "$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 diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 707f594..855808b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -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