Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

update workflows and actions #31

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/case.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Check file name case

on: [pull_request]

concurrency:
group: case-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: Check file name case
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Verify links

on: [pull_request]

concurrency:
group: links-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: Run check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Links check
uses: ./actions/tests/links
with:
DOC_DIR: tests/docs
QUIET_MODE: no
VERBOSE_MODE: yes
31 changes: 27 additions & 4 deletions actions/tests/links/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
name: 'validate links'
description: 'Composite action to validate links'

inputs:
DOC_DIR:
description: 'default directory path from project root'
required: false
default: .
QUIET_MODE:
description: 'default to only show errors in output.'
required: false
default: yes
VERBOSE_MODE:
description: 'default to show detailed HTTP status for checked links.'
required: false
default: yes
CONFIG_FILE:
description: 'default config file.'
required: false
default: common/config/link-check.json
BRANCH:
description: 'default branch'
required: false
default: main

runs:
using: "composite"
steps:
Expand All @@ -15,8 +37,9 @@ runs:
- name: Test links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: yes
use-verbose-mode: yes
use-quiet-mode: ${{ inputs.QUIET_MODE }}
use-verbose-mode: ${{ inputs.VERBOSE_MODE }}
check-modified-files-only: yes
base-branch: main
config-file: ./.doctools.action-builder/common/config/link-check.json
base-branch: ${{ inputs.BRANCH }}
config-file: ${{ inputs.CONFIG_FILE }}
folder-path: ${{ inputs.DOC_DIR }}
21 changes: 20 additions & 1 deletion common/config/link-check.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,26 @@
"pattern": "^http(s)?://help.figma.com"
},
{
"pattern": "^http(s)?://docs.github.com"
"comment": "Skip urls in the redoc macro with entity",
"pattern": "http(s)?://.+\\&\\#39\\;"
}
,
{
"comment": "Skip urls in the redoc macro with char",
"pattern": "http(s)?://.+'"
}
],
"httpHeaders": [
{
"urls": [
"https://github.com/",
"https://guides.github.com/",
"https://help.github.com/",
"https://docs.github.com/"
],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
],
"timeout": "30s",
Expand Down
5 changes: 5 additions & 0 deletions tests/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ description: Doc sample for build test
# Doc sample file

This is a sample doc file for MkDocs to build.

The following links are made to detect if the link checker tools starts to detect external anchors.
[This one should fail but is currently not](https://github.com/ConsenSys/doctools.action-builder#non-existing-anchor)

[This is a link to Github that should work](https://docs.github.com/en/actions)