Skip to content

Commit

Permalink
Fix markdown URL check false negatives in CI/CD
Browse files Browse the repository at this point in the history
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
undergroundwires committed Jan 26, 2025
1 parent e11821f commit 799998d
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.{scss}] # SASS guidelines: https://archive.today/2024.02.16-232553/https://sass-guidelin.es/
[*.{scss}] # SASS guidelines: https://archive.ph/2024.02.16-232553/https://sass-guidelin.es/
indent_style = space
indent_size = 2 # Recommended by SASS guidelines
max_line_length = 100 # Recommended by SASS guidelines
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/force-ipv4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ This action is a workaround addressing specific IPv6-related connectivity issues
[2]: https://archive.ph/2024.03.28-185838/https://github.com/actions/runner-images/issues/668 "IPv6 on GitHub-hosted runners · Issue #668 · actions/runner-images · GitHub | github.com"
[3]: https://archive.ph/2024.03.28-185847/https://github.com/actions/runner/issues/3213 "GitHub runner cannot send `fetch` with `node`, failing with IPv6 DNS error `UND_ERR_CONNECT_TIMEOUT` · Issue #3213 · actions/runner · GitHub | github.com"
[4]: https://archive.ph/2024.03.28-185853/https://github.com/actions/runner-images/issues/9540 "Cannot send outbound requests using node fetch, failing with IPv6 DNS error UND_ERR_CONNECT_TIMEOUT · Issue #9540 · actions/runner-images · GitHub | github.com"
[5]: https://archive.today/2024.03.30-113315/https://github.com/nodejs/node/issues/40537 "\"localhost\" favours IPv6 in node v17, used to favour IPv4 · Issue #40537 · nodejs/node · GitHub"
[5]: https://archive.ph/2024.03.30-113315/https://github.com/nodejs/node/issues/40537 "\"localhost\" favours IPv6 in node v17, used to favour IPv4 · Issue #40537 · nodejs/node · GitHub"
[6]: https://archive.ph/2024.03.28-185900/https://github.com/nodejs/node/issues/41625 "Happy Eyeballs support (address IPv6 issues in Node 17) · Issue #41625 · nodejs/node · GitHub | github.com"
[7]: https://archive.ph/2024.03.28-185910/https://github.com/nodejs/undici/issues/1531 "fetch times out in under 5 seconds · Issue #1531 · nodejs/undici · GitHub | github.com"
2 changes: 1 addition & 1 deletion .github/workflows/checks.quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- npm run lint:md:relative-urls
- npm run lint:md:external-urls
os: [ macos, ubuntu, windows ]
fail-fast: false # Still interested to see results from other combinations
fail-fast: false # Still interested to see results from other commands
steps:
-
name: Checkout
Expand Down
29 changes: 29 additions & 0 deletions .remark-lint-no-dead-urls.js
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+)?/.*$`;
}
2 changes: 1 addition & 1 deletion docs/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ Convention for naming pipeline files: **`<type>.<name>.yaml`**.
- Kebab-case allows to have better URL references to them.
- [README.md](./../README.md) uses URL references to show status badges for actions.

[1]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows
[1]: https://web.archive.org/web/20250126141528/https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows "Workflow syntax for GitHub Actions - GitHub Docs | docs.github.com"
2 changes: 1 addition & 1 deletion docs/script-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Key attributes of a good script:

- Use credible and reputable sources for references.
- Use archived links by using [archive.org](https://archive.org) or [archive.ph](https://archive.ph).
- Format archive.today links fully, for example: `https://archive.ph/YYYYMMDDhhmmss/https://privacy.sexy`.
- Format archive.today/archive.ph links fully, for example: `https://archive.ph/YYYYMMDDhhmmss/https://privacy.sexy`.
- Explain the default behavior if the script is not executed.

## Shared functions
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"lint:md": "markdownlint **/*.md --ignore node_modules",
"lint:md:consistency": "remark . --frail --use remark-preset-lint-consistent",
"lint:md:relative-urls": "remark . --frail --use remark-validate-links",
"lint:md:external-urls": "remark . --frail --use remark-lint-no-dead-urls",
"lint:md:external-urls": "remark . --frail --rc-path .remark-lint-no-dead-urls.js",
"lint:yaml": "yamllint **/*.yaml --ignore=node_modules/**/*.yaml",
"lint:pylint": "pylint **/*.py",
"postinstall": "electron-builder install-app-deps",
Expand Down
2 changes: 1 addition & 1 deletion src/application/collections/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27545,7 +27545,7 @@ actions:
[1]: https://web.archive.org/web/20241108211338/https://learn.microsoft.com/en-us/windows-hardware/drivers/install/updating-driver-files "Updating Driver Files - Windows drivers | Microsoft Learn | learn.microsoft.com"
[2]: https://web.archive.org/web/20241108210850/https://www.thewindowsclub.com/windows-keeps-installing-old-intel-graphics-driver "Windows keeps installing old Intel Graphics Driver | www.thewindowsclub.com"
[3]: https://web.archive.org/web/20241108210848/https://djdallmann.github.io/GamingPCSetup/CONTENT/DOCS/POSTINSTALL/ "Post Installation Steps | GamingPCSetup | djdallmann.github.io"
[4]: https://archive.today/2024.11.08-211401/https://github.com/privacysexy-forks/10_0_22622_601/blob/c598035e1a6627384d646140fe9e4d234b36b11d/C/Windows/SysWOW64/newdev.dll.strings "10_0_22622_601/C/Windows/SysWOW64/newdev.dll.strings at c598035e1a6627384d646140fe9e4d234b36b11d · privacysexy-forks/10_0_22622_601 | github.com"
[4]: https://archive.ph/2024.11.08-211401/https://github.com/privacysexy-forks/10_0_22622_601/blob/c598035e1a6627384d646140fe9e4d234b36b11d/C/Windows/SysWOW64/newdev.dll.strings "10_0_22622_601/C/Windows/SysWOW64/newdev.dll.strings at c598035e1a6627384d646140fe9e4d234b36b11d · privacysexy-forks/10_0_22622_601 | github.com"
call:
-
function: SetRegistryValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class LoggingNodeShellCommandRunner implements ShellCommandRunner {
this.logger.info(`Executing command: ${command}`);
return new Promise((resolve) => {
this.systemOps.command.exec(command)
// https://archive.today/2024.01.19-004011/https://nodejs.org/api/child_process.html#child_process_event_exit
// https://archive.ph/2024.01.19-004011/https://nodejs.org/api/child_process.html#child_process_event_exit
.on('exit', (
code, // The exit code if the child exited on its own.
signal, // The signal by which the child process was terminated.
Expand Down
4 changes: 2 additions & 2 deletions src/presentation/assets/styles/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ $font-family-cursive : 'Yesteryear', cursive;
We prefix each variable with its type (absolute or relative) for clear identification and context.
*/
// Absolute sizes use the <absolute-size> CSS data type, representing specific, fixed sizes unaffected by the parent element's size.
// See: https://archive.today/2024.02.02-005228/https://developer.mozilla.org/en-US/docs/Web/CSS/absolute-size.
// See: https://archive.ph/2024.02.02-005228/https://developer.mozilla.org/en-US/docs/Web/CSS/absolute-size.
$font-size-absolute-x-small : 13px;
$font-size-absolute-small : 15px;
$font-size-absolute-normal : 17px;
$font-size-absolute-large : 21px;
$font-size-absolute-x-large : 27px;
$font-size-absolute-xx-large : 40px;
// Relative sizes employ the <relative-size> CSS data type, allowing font size adjustments based on the parent element's size.
// See: https://archive.today/2024.02.02-010054/https://developer.mozilla.org/en-US/docs/Web/CSS/relative-size.
// See: https://archive.ph/2024.02.02-010054/https://developer.mozilla.org/en-US/docs/Web/CSS/relative-size.
$font-size-relative-smallest : 80%;
$font-size-relative-smaller : 85%;
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* implementation of Node.js.
*
* For more detailed information, visit:
* - https://archive.today/2024.03.13-102042/https://httptoolkit.com/blog/tls-fingerprinting-node-js/
* - https://archive.ph/2024.03.13-102042/https://httptoolkit.com/blog/tls-fingerprinting-node-js/
* - https://check.ja3.zone/ (To check your tool's or browser's fingerprint)
* - https://github.com/lwthiker/curl-impersonate (A solution for curl)
* - https://github.com/depicts/got-tls (Cipher manipulation support for Node.js)
Expand Down Expand Up @@ -49,7 +49,7 @@ export function getTlsContextInfo(): string {
* matching known fingerprints that could identify the client as a Node.js application.
*
* For more details, refer to:
* - https://archive.today/2024.03.13-102234/https://getsetfetch.org/blog/tls-fingerprint.html
* - https://archive.ph/2024.03.13-102234/https://getsetfetch.org/blog/tls-fingerprint.html
*/
export function getShuffledCiphers(): readonly string[] {
const nodeOrderedCipherList = constants.defaultCoreCipherList.split(':');
Expand Down

0 comments on commit 799998d

Please sign in to comment.