Skip to content

Commit

Permalink
wip: troubleshoot action
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianrbz committed Jul 2, 2024
1 parent 0e0b002 commit 1fafffe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "21"
- name: Wait for Pages changed to be neutral
uses: fountainhead/[email protected]
id: waitForCheck
Expand Down
12 changes: 6 additions & 6 deletions tools/_utilities/lib/src-to-urls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
Accepts a file path in app/_src and returns all URLs that the file renders
*/

import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

import fg from 'fast-glob';
import fg from "fast-glob";
import { load } from "js-yaml";
import { readFileSync } from "fs";
import extractNavWithMeta from "./nav-to-urls.mjs";

import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

async function loadNavEntries(pattern) {
let navEntries = await fg(
`${__dirname}/../../../app/_data/docs_nav_${pattern}.yml`,
Expand Down
4 changes: 2 additions & 2 deletions tools/broken-link-checker/lib/check-url-list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pkg from 'broken-link-checker';
import pkg from "broken-link-checker";
const { HtmlUrlChecker } = pkg;

import ignoredTargets from "../config/ignored_targets.json?type=json" assert { type: 'json' };
import ignoredTargets from "../config/ignored_targets.json?type=json" assert { type: "json" };

export function checkUrls(changes, opts) {
return new Promise((resolve) => {
Expand Down
8 changes: 4 additions & 4 deletions tools/broken-link-checker/run.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Octokit } from "@octokit/rest";
import { context } from '@actions/github';
import { context } from "@actions/github";

import fg from "fast-glob";
import minimist from 'minimist';
import minimist from "minimist";
const argv = minimist(process.argv.slice(2));

import srcToUrls from "../_utilities/lib/src-to-urls.mjs";
import convertFilePathsToUrls from "../_utilities/path-to-url.mjs";
import { checkUrls } from "./lib/check-url-list.js";
import srcToUrls from "../_utilities/lib/src-to-urls.mjs";
import ignoredPaths from './config/ignored_paths.json' assert { type: 'json' };
import ignoredPaths from "./config/ignored_paths.json?type=json" assert { type: "json" };

const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
Expand Down

0 comments on commit 1fafffe

Please sign in to comment.