-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix false negatives in markdown URL checks in C/CD
This commit improves CI/CD workflows reliability by configuring URL validation to avoid false positives. The separate config files makes URL validation rules more maintainable and easier to update. Allowlisting specific domains prevents workflow disruptions. Key changes: - Move URL validation config to dedicated file for better maintainability - Add allowlist for known valid domains triggering false negatives - Update GitHub docs URL to prevent link failures
- Loading branch information
1 parent
e11821f
commit e99a407
Showing
4 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'; | ||
|
||
/** @type {import('remark-lint-no-dead-urls').Options} */ | ||
const Options = { | ||
skipUrlPatterns: [ | ||
// These result in false negatives | ||
'archive.ph', | ||
'scoop.sh', | ||
'localhost:8080', | ||
'web.archive.org', | ||
].map(buildUrlPattern), | ||
}; | ||
|
||
/** @type {Omit<import('unified-engine').Preset} */ | ||
export default { | ||
plugins: [[remarkLintNoDeadUrls, Options]], | ||
}; | ||
|
||
function buildUrlPattern(fqdn) { | ||
const escaped = fqdn.replace(/\./g, '\\.'); | ||
return `^https://${escaped}/.*$`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters