Skip to content

fix(release): validate packaged NuGet README#197

Open
GaTTGeng wants to merge 2 commits into
masterfrom
fix/nuget-readme-validation
Open

fix(release): validate packaged NuGet README#197
GaTTGeng wants to merge 2 commits into
masterfrom
fix/nuget-readme-validation

Conversation

@GaTTGeng

Copy link
Copy Markdown
Owner

What does this PR do?

  • Replaces the raw-HTML README wordmark with NuGet-compatible Markdown.
  • Validates every packed .nupkg contains the source README.md and rejects unsupported raw HTML before artifact upload or NuGet publication.
  • Records the release-process hardening under [Unreleased].

Why is this change needed?

NuGet.org displays the existing <h1> and <img> tags as literal text, leaving the package page malformed.

Fixes #196

How was this tested?

  • Passed: dotnet pack HelmSharp.sln --configuration Release --no-build --no-restore --output C:\tmp\helmsharp-readme-validation-20260717

  • Passed: ./scripts/VerifyPackageReadme.ps1 -PackageDirectory C:\tmp\helmsharp-readme-validation-20260717 (9 packages)

  • Attempted: dotnet test HelmSharp.sln --configuration Release --no-build --no-restore; four existing network-dependent golden tests failed on HTTP 502 across net8.0, net9.0, and net10.0.

  • dotnet build HelmSharp.sln --configuration Release

  • dotnet test HelmSharp.sln --configuration Release

Checklist

  • Code follows the existing style of the project
  • New release validation covers the changed packaging behavior
  • No unrelated changes are included

Use NuGet-compatible Markdown for the package README and verify every package carries the validated source file before upload or publication.
@GaTTGeng
GaTTGeng marked this pull request as ready for review July 17, 2026 05:54
Copilot AI review requested due to automatic review settings July 17, 2026 05:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 035ce9133a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/VerifyPackageReadme.ps1 Outdated
Detect unsupported HTML elements anywhere outside Markdown code spans and fenced code blocks so NuGet README validation cannot be bypassed by inline content.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b991c434b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

)

$inCodeFence = $false
$unsupportedHtmlPattern = '</?(?:address|article|aside|blockquote|caption|center|col|colgroup|details|dialog|dir|div|dl|dt|dd|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|img|input|legend|li|link|main|menu|nav|ol|p|pre|script|section|style|summary|table|tbody|td|tfoot|th|thead|title|tr|ul)\b[^>]*>'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject unsupported HTML tags outside the hard-coded list

The validator only recognizes the enumerated element names, so raw HTML such as <span>text</span>, <a href="...">, <br>, or <svg> passes validation even though NuGet's Markdown renderer does not support raw HTML. In that scenario the release workflow still uploads a README containing literal markup; match arbitrary HTML element names outside code spans/fences rather than maintaining an incomplete block-tag allowlist.

Useful? React with 👍 / 👎.

Comment on lines +19 to +20
if ($line -match '^\s*(```|~~~)') {
$inCodeFence = -not $inCodeFence

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Track the opening Markdown fence marker

This toggles state for every line beginning with either three backticks or three tildes, regardless of the opener's marker, length, or valid indentation. For example, ~~~ inside a backtick-fenced example incorrectly ends validation's fence, and the real closing backticks then put it back inside one, allowing raw HTML later in the README to escape validation; similarly, four-space-indented backticks are not a CommonMark fence but disable checks here. Track the actual opening marker and minimum length, and only accept a corresponding valid closing fence.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(release): validate NuGet package README rendering

2 participants