UmbrellaDocs / linkspector

Uncover broken links in your content.
Apache License 2.0
64 stars 9 forks source link

[BUG] Link checking `dirs` is broken on Windows and GitHub #86

Open Archmonger opened 3 weeks ago

Archmonger commented 3 weeks ago

Describe the bug It appears that the linkspector github action does not even attempt to scan any files within dirs, which I've managed to replicate on my local Windows machine as well.

However, anything listed within files does appear to be working at the moment.

To Reproduce Steps to reproduce the behavior:

  1. Create any environment where linkspector can run (either a github action or local environment)
  2. Create a .linkspector.yml and specify anything within the dirs setting, for example...
dirs:
    - ./docs
  1. Run linkspector check and watch it not scan any files.

Expected behavior Have linkspector check recursively scan dirs and return errors for failed links.

Screenshots N/A

Additional context I am assuming it is related to the unsupported engine errors I've seen during install time on both the GH workflow and on my local machine.

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'glob@11.0.0',
npm WARN EBADENGINE   required: { node: '20 || >=22' },
npm WARN EBADENGINE   current: { node: 'v18.13.0', npm: '9.8.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'jackspeak@4.0.2',
npm WARN EBADENGINE   required: { node: '20 || >=22' },
npm WARN EBADENGINE   current: { node: 'v18.13.0', npm: '9.8.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'minimatch@10.0.1',
npm WARN EBADENGINE   required: { node: '20 || >=22' },
npm WARN EBADENGINE   current: { node: 'v18.13.0', npm: '9.8.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'path-scurry@2.0.0',
npm WARN EBADENGINE   required: { node: '20 || >=22' },
npm WARN EBADENGINE   current: { node: 'v18.13.0', npm: '9.8.1' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'lru-cache@11.0.1',
npm WARN EBADENGINE   required: { node: '20 || >=22' },
npm WARN EBADENGINE   current: { node: 'v18.13.0', npm: '9.8.1' }
npm WARN EBADENGINE }
antoineco commented 1 week ago

I tried to reproduce this in a GitHub Action via UmbrellaDocs/action-linkspector.

The directory traversal works on my side:

--- .linkspector.yml
+++ .linkspector.yml
@@ -1,3 +1,3 @@
- dirs: [ . ]
+ dirs: [ ./extensions ]
 ignorePatterns:
   - pattern: '^http:\/\/localhost:'
--- a/extensions/enterprise-search/README.md
+++ b/extensions/enterprise-search/README.md
@@ -139,6 +139,6 @@ Docker container: [Running Enterprise Search Using Docker][enterprisesearch-dock
 [enterprisesearch-docs]: https://www.elastic.co/guide/en/enterprise-search/current/index.html
 [enterprisesearch-kb]: https://www.elastic.co/guide/en/kibana/current/enterprise-search-settings-kb.html

-[es-security]: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#api-key-service-settings
+[es-security]: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settingx.html#api-key-service-settings
 [config-es]: ../../elasticsearch/config/elasticsearch.yml
 [config-kbn]: ../../kibana/config/kibana.yml

Workflow summary:

Annotations
2 errors

❌ [linkspector] extensions/enterprise-search/README.md#L142: extensions/enterprise-search/README.md#L142
   Cannot reach https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settingx.html#api-key-service-settings. Status: 404

❌ Check Markdown
   Process completed with exit code 1.