Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Approved submission PRs are finalized by `.github/workflows/publish-approved-the

The issue-form automation was hardened on 2026-05-15 so user-correctable issue form errors exit as incomplete submissions, comment the required fix on the issue, and skip PR generation without hiding internal workflow failures.

GitHub `blob` screenshot links are normalized to include `raw=true` before download so submission automation stores the image rather than the GitHub HTML page.

## Observations
- [entry_point] New theme submissions use the `Submit a theme` GitHub Issue Form #submissions
- [automation] Complete submission issues become candidate PRs #submissions
Expand All @@ -26,6 +28,7 @@ The issue-form automation was hardened on 2026-05-15 so user-correctable issue f
- [human_review] Maintainers still merge approved submission PRs explicitly #review
- [issue_closure] Merged submission PRs close their source issue through `close-merged-theme-submission.yml` #issues
- [hardening] On 2026-05-15, user-correctable issue form errors began exiting as incomplete submissions with a comment and no PR #history
- [screenshots] GitHub `blob` screenshot URLs receive `raw=true` before download #images

## Relations
- contributes_to [[Theme Catalog Source of Truth]]
Expand Down
22 changes: 21 additions & 1 deletion scripts/create-theme-submission-from-issue.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,31 @@ function extractScreenshotUrls(value) {
}

function cleanUrl(value) {
return value
const cleaned = value
.trim()
.replace(/^["']+|["']+$/g, '')
.replace(/[.,;:]+$/, '')
.replace(/["'\]]+$/, '')

return normalizeScreenshotUrl(cleaned)
}

function normalizeScreenshotUrl(value) {
let url

try {
url = new URL(value)
} catch {
return value
}

if (['github.com', 'www.github.com'].includes(url.hostname.toLowerCase()) && url.pathname.includes('/blob/')) {
if (url.searchParams.get('raw') !== 'true') {
url.searchParams.set('raw', 'true')
}
}

return url.toString()
}

function normalizeTags(value) {
Expand Down
Loading