Add template workflow to check Markdown files for problems #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On every push and pull request that affects relevant files, and periodically, check the repository's Markdown files for
problems:
The Arduino tooling Markdown style is defined by the
.markdownlint.yml
file.In the event the repository contains externally maintained Markdown files, markdownlint can be configured to ignore them via a
.markdownlintignore
file:https://github.com/igorshubovych/markdownlint-cli#ignoring-files
markdown-link-check is configured via the
.markdown-link-check.json
file:https://github.com/tcort/markdown-link-check#config-file-format
The workflow is also used for this repository's own CI.
Notes
Failure of the link check CI is expected currently due to:
arduino
organization.I have always been bothered by the lack of compatibility of our link check task with Windows.
The code used to iterate over the repository's Markdown files is in Bash. Normally this works perfectly well on Windows due to Task using a built-in shell interpreter independent from whatever is in use natively on the machine running the task. However, this particular Bash code is run by
npx --call
, which uses the native shell of the operating system. This means the Bash code is run incmd
on Windows machines, which doesn't work. I have spent a ton of time trying to find a way to get this working withnpx --call
on Windows:The solution I settled on is to simply abandon the use of npx on Windows, instead requiring Windows users to have markdown-link-check pre-installed and in
PATH
. This allows the use of the Bash code directly in the task. Other operating systems continue to use the traditional npx approach. Even though this isn't an ideal solution, it's a great improvement over the previous one where it was impossible for Windows contributors to run the task.