Skip to content

Commit

Permalink
update inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
recrwplay committed Jan 5, 2024
1 parent 9420244 commit e22ef94
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions .github/workflows/reusable-docs-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,28 @@ name: Check links
on:
workflow_call:
inputs:
package-script:
description: 'The name of the script to run in package.json '
docs-path:
description: 'The path to the docs to check'
type: string
default: 'check-links'
default: 'build/site'
skipfile:
description: 'The path to the skipfile'
type: string
default: '.docs-tools/link-checker/ignore-links.txt'
retain-artifacts:
description: 'The number of days to retain artifacts'
type: number
default: 7
workflow_dispatch:
inputs:
package-script:
description: 'The name of the script to run in package.json '
required: true
docs-path:
description: 'The path to the docs to check'
type: string
default: 'build/site'
skipfile:
description: 'The path to the skipfile'
type: string
default: 'check-links'
default: '.docs-tools/link-checker/ignore-links.txt'
retain-artifacts:
description: 'The number of days to retain artifacts'
type: number
Expand All @@ -28,16 +35,19 @@ jobs:
runs-on: ubuntu-latest

env:
PACKAGE_SCRIPT: ${{ inputs.package-script }}
DOCS_PATH: ${{ inputs.docs-path }}
SKIPFILE: ${{ inputs.skipfile }}

steps:

steps:
- name: Checkout package file
uses: actions/checkout@v3
- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: neo4j/docs-tools
ref: dev
sparse-checkout: |
package.json
scripts/
sparse-checkout-cone-mode: false
link-checker
path: .docs-tools

- name: Download HTML
uses: actions/download-artifact@v3
Expand All @@ -53,9 +63,9 @@ jobs:
- name: Install link checker
run: npm install github:recrwplay/link-checker#v0.2.0

- name: Run package script
- name: Run link checker
run: |
npm run $PACKAGE_SCRIPT |& tee link-log.txt
npx link-checker $DOCS_PATH --skip-file $SKIPFILE |& tee link-log.txt
warncount=$(grep -e "[0-9]* warnings" -o link-log.txt | sed 's/ warnings//' )
if [ $warncount -gt 0 ]; then
echo "::warning:: $warncount warnings"
Expand Down

0 comments on commit e22ef94

Please sign in to comment.