Skip to content

docs: add a "Used by" company showcase with a submission form - #30

Merged
Schero94 merged 2 commits into
mainfrom
docs/showcase
Nov 20, 2026
Merged

Schero94 merged 2 commits into
mainfrom
docs/showcase

Conversation

@Schero94

Copy link
Copy Markdown
Owner

Summary

Adds a "Used by" company showcase to the Magic Session Manager documentation site. Companies submit themselves with a new issue form; a maintainer approves with a label; a workflow validates the issue and opens a docs: pull request that adds the logo and the entry. The site renders the list as static HTML at build time, so search engines and AI crawlers see it without JavaScript.

Same mechanism in all seven Schero94 plugin repositories: showcase.mjs, its tests and showcase.yml (workflow) are byte-identical; the form and the site differ only in the plugin name and URLs.

What changes

  • .github/ISSUE_TEMPLATE/showcase.yml: title "Showcase: ", label showcase; company name, https website, logo (image dropped into the field, so a github.com/user-attachments URL), optional one-line description (max 140 characters), three required permission checkboxes.
  • .github/ISSUE_TEMPLATE/config.yml: contact link to the Used by section; blank-issue setting unchanged.
  • .github/scripts/showcase.mjs (dependency-free) and showcase.test.mjs (node:test, synthetic fixtures only).
  • .github/workflows/showcase.yml, triggered by issues: labeled:
    • prepare (read-only token): ignores the label unless the person who added it has admin, maintain or write permission (GET /collaborators/{user}/permission). Reads the issue from $GITHUB_EVENT_PATH as untrusted data; nothing from the issue is interpolated into a run: script.
    • Validation: exact form headings once each; name 2 to 60 characters from an allowlist (no markup, @, #, square brackets or backticks); website https only, no credentials, port, IP literal or internal/reserved host; description plain text, no links; all three checkboxes ticked; exactly one https://github.com/user-attachments/assets/<uuid> URL.
    • Logo: downloaded without a token, redirects followed by hand only to GitHub's asset hosts over https, 500 KB cap, 15 s timeout; magic bytes must be PNG, JPEG or WebP (SVG and everything else rejected); 16 px to 4096 x 4096 px; re-encoded with sharp 0.35.5 (exact version, installed outside the repo with --ignore-scripts) to a WebP of at most 320 x 160 without metadata; stored as docs/site/showcase/<slug>.webp.
    • publish (contents, pull-requests, issues: write): validates the prepare result again, adds the entry to docs/site/showcase.json sorted by name ({ name, url, logo, description, issue, addedAt }), sets the sitemap lastmod, pushes showcase/add-<slug>, opens a pull request titled docs: add <company> to the showcase (no npm release) and comments the link on the issue. A rejection comments the reason (never the submitted text) and removes the label.
    • showcase-remove on an issue that names a listed company (or on its original showcase issue) opens a removal pull request the same way.
  • .github/workflows/pages.yml: renders showcase.json into index.html and llms.txt before the version stamp.
  • .github/workflows/test.yml: runs the showcase unit tests.
  • docs/site: new #used-by section and nav link, showcase.json = [] (empty-state call to action linking to issues/new?template=showcase.yml), "Used by" section in llms.txt, styles appended to site-extra.css (site.css stays byte-identical).
  • README.md: "Showcase your company".

Rendering

  • Logo grid: alt = company name, width/height from the stored file, loading="lazy", link to the company site with rel="ugc noopener" and no forced target. Google asks for rel="ugc" (or nofollow) on user-submitted links; noopener costs nothing.
  • Light neutral tiles in both colour schemes, so dark logos stay visible in dark mode.
  • The call to action stays under a filled grid.
  • JSON-LD: the FAQPage node (the page itself) gets mentions with Organization items (name, url, logo) when the list is not empty; mentions is a schema.org CreativeWork property, so nothing is invented.

Verification

  • npm run lint, npm run format:check, the repository tests and node --test .github/scripts/showcase.test.mjs pass locally; actionlint passes on all workflows.
  • The showcase tests cover script tags, javascript: and data: URLs, credentials, IPv4/IPv6/decimal IP hosts, internal hosts, SVG, an animated PNG, a 50000 x 50000 header, a 600 KB download, a redirect to a foreign host, a non-attachment logo host, a missing checkbox, smuggled form headings and tampered prepare results.
  • Local end-to-end build with three synthetic entries ("Example Co", "Example Labs", "Sample Systems GmbH") through prepare, apply, render and the version stamp; headless Playwright at 1440, 390 and 320 px in light and dark: no horizontal overflow, logos inside their tiles, no console errors or failed requests. The synthetic entries are not committed; showcase.json ships as [].
  • Live check: the download path followed a real public user-attachments redirect to github-production-user-asset-6210df.s3.amazonaws.com (data discarded).

Notes

  • "Allow GitHub Actions to create and approve pull requests" is off in this repository. The workflow still pushes the branch and then comments a one-click compare link instead of opening the pull request. Enable the setting (Settings > Actions > General) to get the pull request directly.
  • Pull requests opened with GITHUB_TOKEN do not start CI; merging still deploys Pages.
  • Commit types are ci: and docs:; semantic-release publishes nothing for them.

🤖 Generated with Claude Code

Schero94 and others added 2 commits November 20, 2026 13:52
Companies submit their name, website, logo and an optional one-line
description with the new issue form. A maintainer approves with the
showcase-approved label (or asks for a removal with showcase-remove).

- .github/scripts/showcase.mjs (dependency-free, same file in every plugin
  repository) validates the issue as untrusted data: exact form headings,
  plain-text name and description, public https website without
  credentials, IP literals or internal hosts, all three consent boxes, and
  exactly one github.com/user-attachments logo URL. The logo is downloaded
  without a token, following redirects only to GitHub's asset hosts, with a
  500 KB cap and a timeout, checked by magic bytes (PNG, JPEG or WebP, no
  SVG) and pixel size, then re-encoded by sharp 0.35.5 to a WebP of at most
  320 x 160 without metadata.
- .github/workflows/showcase.yml: a read-only prepare job (labeller must
  have write, maintain or admin access) and a publish job that validates
  the result again, pushes showcase/<add|remove>-<slug>, opens a docs: pull
  request and comments on the issue; rejections comment the reason and
  remove the label.
- pages.yml renders docs/site/showcase.json before deploying; CI runs
  the showcase unit tests (synthetic fixtures, hostile input included).

Docs read (2026-11-20): GitHub issue forms syntax and form schema
(docs.github.com), GET /repos/{owner}/{repo}/collaborators/{username}/permission
(permission maps maintain to write), workflow syntax jobs.<id>.outputs
(1 MB per job), sharp v0.35.5 constructor, resize, webp and toBuffer
(context7 /lovell/sharp/v0.35.5), Google "Qualify your outbound links"
(rel=ugc), schema.org/mentions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New #used-by section with an empty state that links to the showcase
  form; once companies are listed it shows a logo grid (alt text, width,
  height, lazy loading, rel="ugc noopener") rendered at build time.
- docs/site/showcase.json starts empty; llms.txt gains a "Used by"
  section; the FAQPage JSON-LD node gets schema.org mentions when entries
  exist; the moderation workflow updates the sitemap lastmod.
- Showcase styles live in site-extra.css (site.css stays byte-identical):
  light neutral logo tiles in both colour schemes, 2 columns from 320 px.
- README: "Showcase your company".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Schero94
Schero94 merged commit 46aa166 into main Nov 20, 2026
10 checks passed
@Schero94
Schero94 deleted the docs/showcase branch November 20, 2026 12:58
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.

1 participant