From 414334405201da601224307dd406574e2028ce6e Mon Sep 17 00:00:00 2001 From: Mykola Fant Date: Mon, 18 Nov 2024 11:30:35 +0200 Subject: [PATCH] Install links checker library in the action (#416) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Old docs branches don't have the library `@jcahills/antora-link-checker` installed, so need to install it in the common action --------- Signed-off-by: devOpsHelm Co-authored-by: Oliver Howell Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: devopshazelcast Co-authored-by: devOpsHelm <54980549+devOpsHelm@users.noreply.github.com> Co-authored-by: Nishaat Rajabali <12186256+nishaatr@users.noreply.github.com> Co-authored-by: YĆ¼ce Tekol --- .github/actions/validate/action.yml | 2 +- lib/load-check-links-playbook.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml index 8eef321e..3ee5c35b 100644 --- a/.github/actions/validate/action.yml +++ b/.github/actions/validate/action.yml @@ -25,6 +25,6 @@ runs: run: | cp "./hazelcast-docs/lib/load-check-links-playbook.js" "./load-check-links-playbook.js" npm i - npm i -D yaml@2.6.0 + npm i -D yaml@2.6.0 @jcahills/antora-link-checker@1.0.1 node load-check-links-playbook.js $GITHUB_REPOSITORY $GITHUB_BASE_REF ./node_modules/.bin/antora --fetch --to-dir test --log-level=error --log-failure-level=error --extension=@jcahills/antora-link-checker check-links-playbook.yml diff --git a/lib/load-check-links-playbook.js b/lib/load-check-links-playbook.js index 86fb1938..eaa38b72 100644 --- a/lib/load-check-links-playbook.js +++ b/lib/load-check-links-playbook.js @@ -20,6 +20,7 @@ const localAntoraPlaybook = YAML.parse(localAntoraPlaybookContent); const globalAntoraPlaybookContent = fs.readFileSync('./hazelcast-docs/antora-playbook.yml', 'utf8'); const globalAntoraPlaybook = YAML.parse(globalAntoraPlaybookContent); let globalSources = globalAntoraPlaybook.content.sources; + // 3. Modify global content.sources // - add hazelcast-docs GitHub URL const hazelcastDocsSource = globalSources.find(source => source.url === '.'); @@ -39,7 +40,7 @@ globalSources.unshift({ start_path: 'docs', }); -// - remove current target branch from the global content list +// - remove current target branch from the global content list by adding the branch name with the "!" prefix const currentRepoSource = globalSources.find(source => source.url.endsWith(currentRepoName)); currentRepoSource.branches.push(`!${baseBranchName}`);