-
-
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 markdown URL check false negatives in CI/CD
This commit improves CI/CD workflows reliability by configuring URL validation to avoid false positives. It introduces a new separate config file to allow whitelisting specific domains and files to prevent 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 - Use `archive.ph` over `archive.today` for consistency - Ignore `CHANGELOG.md` from URL checks
- Loading branch information
1 parent
e11821f
commit 799998d
Showing
11 changed files
with
41 additions
and
12 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
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,29 @@ | ||
import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'; | ||
|
||
/** @type {import('remark-lint-no-dead-urls').Options} */ | ||
const PluginOptions = { | ||
skipUrlPatterns: [ | ||
// These result in false negatives | ||
'archive.ph', | ||
'scoop.sh', | ||
'localhost', | ||
'archive.org', | ||
].map(buildUrlPattern), | ||
}; | ||
|
||
/** @type {import('unified-engine').Options} */ | ||
const EngineOptions = { | ||
ignorePatterns: ['CHANGELOG.md'], | ||
}; | ||
|
||
/** @type {import('unified-engine').Preset} */ | ||
export default { | ||
plugins: [[remarkLintNoDeadUrls, PluginOptions]], | ||
settings: EngineOptions, | ||
}; | ||
|
||
function buildUrlPattern(fqdn) { | ||
const escaped = fqdn.replace(/\./g, '\\.'); | ||
// Matches http(s)://<domain>[:port]/<path> | ||
return `^https?://${escaped}(?::\\d+)?/.*$`; | ||
} |
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
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
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
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