Skip to content

Commit

Permalink
Third attempt at getting link-checker code from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-heyer committed Jul 31, 2024
1 parent 38cf824 commit 9a4e4a3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
with:
lfs: true
ref: ${{ github.event.pull_request.head.sha }}
path: content
sparse-checkout: |
advocacy_docs
product_docs
Expand All @@ -20,15 +21,17 @@ jobs:
with:
lfs: true
ref: develop
path: ./tools
path: tools
sparse-checkout: |
tools/automation
tools
- name: setup node
uses: actions/setup-node@v4

- name: install dependencies
run: npm --prefix ./tools/automation/actions/link-check ci
run: npm --prefix ./tools/tools/automation/actions/link-check ci

- name: check links
uses: ./tools/automation/actions/link-check
uses: ./tools/tools/automation/actions/link-check
with:
content-path: ./content
3 changes: 3 additions & 0 deletions tools/automation/actions/link-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ inputs:
update-links:
description: "Set to true/1 causes the action to update links where possible to avoid redirects"
required: false
content-path:
description: "The base path for docs content. Path should contain product_docs and/or advocacy_docs subdirectories"
required: false

2 changes: 2 additions & 0 deletions tools/automation/actions/link-check/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ const noWarnPaths = [
"/playground/1/01_examples/link-tests",
"/playground/1/01_examples/link-test",
];

const args = process.argv.slice(2);
const basePath =
args[0] ||
core?.getInput("content-path") ||
path.resolve(path.dirname(new URL(import.meta.url).pathname), "../../../..");

let ghCore = core;
Expand Down

1 comment on commit 9a4e4a3

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.