Skip to content

Commit

Permalink
fix: use slugger locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Joaquin Montes committed Aug 15, 2023
1 parent e40c10d commit aee56a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/actions/validate-docs-links/README.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GitHub Action for Validating Documentation Links

This action ensures that internal links in `.mdx` files in the `/docs/` directory are valid. It runs on every pull request that includes changes to these files.
This action ensures that internal links in `.mdx` files are valid. It runs on every pull request that includes changes to these files and target `main` branch.

The action is triggered by the workflow defined in `.github/workflows/validate-docs-links.yml`.

Expand Down
7 changes: 2 additions & 5 deletions .github/actions/validate-docs-links/src/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,9 @@ type ConfigSchema = Array<{title: string, slug: string, routes: Array<RouteSche
type FailureFunction = (message: string) => void

const RELATIVE_PATH = '/'
const EXCLUDED_HASHES = ['top']
const EXCLUDED_HASHES: string[] = []

const slugger = (process.argv[2] === '--run-local-checker') ? {
slug: (str: string) => str.replace(/\s+/g, '-').toLowerCase(),
reset: () => null
} : new GithubSlugger()
const slugger = new GithubSlugger()

// Collect the paths of all .mdx files present in the config files
async function getAllMdxFilePaths(basePath: string): Promise<RouteFragment[]> {
Expand Down

0 comments on commit aee56a1

Please sign in to comment.