From e22ef94710b1a39e5396bfe02ede8f2c530274ba Mon Sep 17 00:00:00 2001 From: Neil Dewhurst Date: Fri, 5 Jan 2024 13:46:23 +0000 Subject: [PATCH] update inputs --- .github/workflows/reusable-docs-links.yml | 42 ++++++++++++++--------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/reusable-docs-links.yml b/.github/workflows/reusable-docs-links.yml index 2312d1c..21ec772 100644 --- a/.github/workflows/reusable-docs-links.yml +++ b/.github/workflows/reusable-docs-links.yml @@ -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 @@ -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 @@ -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"