Icon contribution automation
Icon contribution automation protects the public icon catalog from bad assets, incomplete requests, and unsafe merges. It combines pull-request checks, issue triage, path labels, review routing, merge rules, catalog lineage checks, and a reviewed snapshot flow for aggregate icon feedback. This page is a child of Release and repository automation, with related release detail in Package release and deployment automation and contributor-side validation in Icon submission and validation.
Quality gates
The quality gates check a contribution when it enters the repository and again before it can merge. They keep SVG assets, catalog records, and public feedback data aligned without relying on one check alone.
flowchart LR
A[Icon issue or pull request] --> B{Contribution type}
B -->|Issue| C[Parse and triage]
B -->|Pull request| D[Path labels and checks]
C --> E[Request missing data or mark ready]
D --> F[Validate and optimize SVG and catalog]
F --> G[Run scoped lint, type, test, and build checks]
E --> H{Ready for merge?}
G --> H
H -->|Eligible| I[Enable squash auto-merge]
H -->|Needs review| J[Keep manual review]
The issue path helps a contributor supply usable source and licensing information. The pull-request path checks the files that will become part of the public catalog, then applies stricter merge rules to new contributors and unresolved requests.
Pull-request checks
Repository checks
The repository check in .github/…/check.yml is the main merge gate for pull requests that change product code or catalog data. It classifies changed paths and runs only the affected lint, type, test, and build jobs. Documentation-only changes and several repository-policy paths do not trigger this gate.
The brand and UI test lanes protect their separate icon sets. Shared changes run both lanes, while site changes run the site build. A final Lint & Build job gives branch protection one stable check name and treats intentionally skipped scoped jobs as passing.
References: .github/…/check.yml• L3-22 .github/…/check.yml• L23-65 .github/…/check.yml• L67-130 .github/…/check.yml• L132-149
Workflow checks
Workflow changes have a separate syntax and expression gate. .github/…/actionlint.yml runs for pull requests to main that change workflow files and fails on actionlint errors, so broken automation is stopped before it can affect contribution checks or releases. It groups concurrent runs for the same pull request and cancels older runs when a newer change arrives.
References: .github/…/actionlint.yml• L3-11 .github/…/actionlint.yml• L13-23
SVG and catalog checks
The fast check in .github/…/validate-svg.yml focuses on pull requests that change public/icons/** or src/…/icons.json. It runs only on the current set of added or changed SVG files. The check enforces a 50 KB limit with reviewed exceptions, well-formed XML, an SVG root, a viewBox, and no scripts, inline event handlers, or embedded raster data except for reviewed legacy assets.
The same pull-request check applies the shared icon quality gate. That gate catches invalid attribute literals, empty paths, missing drawable shapes, duplicate IDs, editor metadata, and non-monochrome variants. It then checks the catalog as a whole for valid JSON structure, unique slugs, ordered entries, required fields on new entries, valid color values, and a default variant.
The workflow cancels an older run when a newer commit arrives for the same pull request. This check gives early feedback on common icon errors. It supplements rather than replaces the repository check, so a passing SVG check does not make a pull request mergeable by itself.
References: .github/…/validate-svg.yml• L3-24 .github/…/validate-svg.yml• L26-55 .github/…/validate-svg.yml• L57-137 .github/…/validate-svg.yml• L138-199 scripts/validate-icons.ts• L15-39 scripts/validate-icons.ts• L119-174
SVG optimization
The SVG optimization flow keeps accepted icon assets in a common form after contributors add or change them. .github/…/svgo.yml runs SVGO on changed files under public/icons/** for pull requests and pushes to main.
Before optimization, the flow removes protected icons from the rewrite list. It uses the catalog license text and an explicit skip list because some brand terms forbid even harmless changes such as minification. The shared license rule keeps the site’s icon behavior and the workflow’s rewrite policy aligned.
For a branch in the repository, the workflow commits the optimized files back to that branch. A fork cannot receive a write from the repository, so its pull request fails when optimization would change the files and tells the contributor to run SVGO locally. After a merge, the push path can optimize the result on main; bot-authored events are excluded to prevent a repeat loop. Runs for the same pull request or branch are serialized by a concurrency group, and a newer run cancels an older one.
References: .github/…/svgo.yml• L1-33 .github/…/svgo.yml• L35-73 .github/…/svgo.yml• L75-91 .github/…/svgo.yml• L97-109 scripts/svgo-protected.mjs• L1-16 src/…/license-terms.mjs• L1-9
Pull-request hygiene
Pull-request hygiene keeps the contribution queue usable without changing the catalog decision. .github/…/hygiene.yml welcomes first-time pull-request authors and runs a scheduled sweep for inactive pull requests. It does not sweep issues because the icon-specific stale flow handles issues with more precise triage labels.
An inactive pull request becomes stale after 30 days and closes seven days later. Updates remove the stale state, while pinned, security, work-in-progress, and blocked-on-maintainer labels exempt a pull request from automatic closure. The welcome action uses a protected event that can comment on fork pull requests without checking out or running their code.
References: .github/…/hygiene.yml• L1-14 .github/…/hygiene.yml• L16-23 .github/…/hygiene.yml• L25-64
Icon issue triage
Issue intake
The issue templates turn common catalog work into structured requests. An icon request asks for the official brand, source SVG or asset link, category, and confirmation that the mark is official. An update request identifies the affected slug and the type of correction. A removal request records the slug, reason, and the reporter's relationship to the brand.
Flag reports use a separate structured form for missing, wrong, or outdated country and region flags. The form requires the affected flag, the problem type, and source and license links, then gives the reporter space to explain the expected artwork or change.
The issue configuration disables blank issues and gives contributors direct links for submitting an icon through the website, browsing the catalog, joining discussions, or asking questions in Discord. This keeps structured catalog requests in their intended forms while routing general questions and submissions to the right channels.
The triage flow only handles requests that it can identify as an icon request or update. Other issues, including flag reports, remain available for normal maintainer handling, while the removal template marks its request for prompt human attention.
References: .github/…/config.yml• L1-14 .github/…/icon_request.yml• L1-88 .github/…/icon_update.yml• L1-49 .github/…/icon_removal.yml• L1-37 .github/…/flag_fix.yml• L1-44 .github/…/triage-issue.mjs• L47-60
Triage decisions
The triage process reads the issue fields and compares the proposed slug with the current catalog. It gives maintainers a short report that includes the parsed identity, category, license, and SVG result. It also writes labels that describe both the kind of work and the next action.
The managed labels are refreshed on each issue edit. This matters because an issue can move from “needs data” to “ready” after the reporter adds an SVG or licensing source. The generated comment is updated instead of duplicated, so the issue keeps one current machine-written summary.
| Decision | Meaning |
|---|---|
triage:ready | A new request has enough data for the next review step. |
triage:needs-svg | A new request does not include SVG content. |
triage:needs-license | The request still needs a usable license value or source. |
triage:invalid-svg | The SVG fails a basic content check. |
triage:svg-oversize | The SVG exceeds the 50 KB limit. |
duplicate | A new request uses a slug already in the catalog. |
References: .github/…/triage-issue.mjs• L158-193 .github/…/triage-issue.mjs• L231-280 .github/…/triage-icon-issue.yml• L52-121
Stale issue handling
The stale-issue process closes blocked icon issues only when they carry a triage:needs-* label. It first marks the issue stale after 14 days without activity and closes it as not planned seven days later. General information requests use a longer 21-day stale period before the same seven-day close window.
New comments or edits remove the stale state and restart the clock. Pull requests are excluded, and maintainer-protected labels can exempt an issue from automatic closure. The close action is housekeeping rather than a final rejection; a reporter can reopen the issue after supplying the missing material.
References: .github/…/stale-icon-issues.yml• L7-29 .github/…/stale-icon-issues.yml• L73-104 .github/…/stale-icon-issues.yml• L182-204
Pull-request labeling
Path labels
Path labels give a pull request a broad area label before the content checks run. Changes to icon assets or the catalog receive icons; changes to the application receive ui; and changes to workflows or scripts receive ci/cd. The labeler synchronizes these labels with the current file set, so a later edit can remove a label that no longer applies.
These labels describe scope. They do not decide whether an icon is safe to merge. The icon triage labels and required checks carry that decision.
References: .github/…/labeler.yml• L3-23 .github/labeler.yml• L1-26
Moderator review requests
Non-draft pull requests request review from the shared glincker/moderators team when they open, reopen, or leave draft state. This gives maintainers a visible review handoff while leaving the actual merge rules to repository ownership and branch protection. A failed request is logged and skipped, so the request is helpful routing rather than the sole safety gate.
References: .github/…/request-moderators.yml• L1-8 .github/…/request-moderators.yml• L10-22
Automatic merge handling
Merge eligibility
The auto-merge workflow enables GitHub's native squash merge only after an icon pull request has the triage:ready label and no unresolved review or blocker label. The pull request must also be out of draft state, must not be from Dependabot, and must not come from a first-time or unknown contributor.
Branch protection supplies the final gate through the Validate SVG and Lint & Build checks. The workflow only removes the manual merge step after those checks and the human-review rules allow it. First-time contributors and requests marked for review remain manual so a maintainer can inspect a new brand source.
References: .github/…/auto-merge-icon-pr.yml• L3-17 .github/…/auto-merge-icon-pr.yml• L19-47
Release handoff
After a contribution reaches main, the version workflow turns publishable catalog changes into a Changeset. A Changeset is a short release record that names the packages that need a patch version. Icon changes also mark the framework packages that re-export the catalog, then the Changesets action opens or updates the version pull request. Release commits are skipped so this handoff does not trigger itself again.
The release window workflow can enable squash auto-merge for that Version PR on a two-hour schedule. It batches changes until the minimum gap and twelve-hour release cap allow a release, unless the hold-release label is present or a maintainer uses the force option. The merge still waits for required checks, so batching controls release timing without bypassing validation.
Once the Version PR merges, the publish workflow builds the public packages, publishes missing versions to npm, creates package tags, and creates a combined GitHub release. A separate CLI release keeps the Homebrew update path working. A manual trigger can retry a failed publish, while a failed package remains visible and fails the job after the other packages finish.
This handoff connects catalog quality gates to package distribution. A catalog change can pass contribution checks yet miss a release record if its path is not covered by the workflow's package map.
References: .github/…/version.yml• L1-23 .github/…/version.yml• L40-67 .github/…/version.yml• L83-120 .github/…/version.yml• L127-136 .github/…/release-window.yml• L1-26 .github/…/release-window.yml• L28-71 .github/…/release.yml• L1-29 .github/…/release.yml• L30-70 .github/…/release.yml• L70-117 .github/…/release.yml• L118-155 .github/…/release.yml• L157-286 .github/…/homebrew-tap-update.yml• L1-22 .github/…/homebrew-tap-update.yml• L27-62
Icon statistics snapshots
The icon statistics flow turns aggregate feedback into a reviewed data change. A scheduled job reads thumbs-up and thumbs-down totals from PostHog, writes a static public/…/icon-stats.json snapshot, and updates one reusable pull request from automated/icon-stats-refresh. It runs every six hours or on demand. Runs are serialized so overlapping jobs do not update the reusable branch at the same time. The slower schedule limits full site rebuilds while this low-volume feature has modest freshness needs.
The snapshot job detects both a changed tracked file and a newly created snapshot file. It commits and pushes only when the snapshot changes. A failed query leaves the last good file unchanged, and an unchanged snapshot does not create a commit. The workflow never pushes directly to main; a changed snapshot is force-pushed to the dedicated branch, so the open pull request always represents the latest totals. The companion auto-merge workflow enables squash merge only for that branch after the normal CI checks pass. The snapshot flow uses a personal token for its checkout, branch update, pull request, and downstream merge trigger so GitHub's anti-recursion rule does not block the next workflow in the chain.
This diagram shows how feedback moves from the event store to the public site through a guarded pull request.
flowchart LR
A[Icon feedback in PostHog] --> B[Fetch aggregate totals]
B --> C[Write static stats snapshot]
C --> D[Update reusable snapshot branch]
D --> E[Open or update pull request]
E --> F[Lint, type check, test, and build]
F --> G[Squash auto-merge]
G --> H[Deploy updated site data]
References: .github/…/icon-stats-snapshot.yml• L1-36 .github/…/icon-stats-snapshot.yml• L38-52 .github/…/icon-stats-snapshot.yml• L54-129 .github/…/auto-merge-icon-stats-pr.yml• L1-41 src/…/fetch-icon-stats.ts• L1-24 src/…/fetch-icon-stats.ts• L271-319
Catalog lineage
Version relationships
Catalog lineage preserves older brand marks when a brand changes its logo. A current entry uses supersedes to point to the older slug, while the older entry uses supersededBy to point back to the current slug. This keeps historical references usable instead of silently replacing the asset at an existing slug.
The catalog page uses this relationship to link each entry to its previous or current version. A lineage record therefore affects both catalog data quality and the way users move between related icons.
References: CONTRIBUTING.md• L163-187 src/…/icons.json• L64687-64720 src/…/icon-detail-page.tsx• L282-311
Lineage validation
The lineage validator treats the two links as one contract. It rejects unknown slugs, one-way links, entries that claim to be both newer and older, and mismatched reciprocal links. The check scans the catalog and reports the number of entries with lineage links when the data is consistent.
The validator is available as node tools/validate-lineage.mjs. Contributor guidance identifies it as a CI check, so any change to a rebrand pair must keep both catalog entries in agreement.
References: tools/validate-lineage.mjs• L1-3 tools/validate-lineage.mjs• L17-59 tools/validate-lineage.mjs• L62-67 CONTRIBUTING.md• L165-194
Change checklist
When these files or sections are changed, remember to consider these:
- When an icon slug or variant path changes, keep the catalog entry and its files under
public/icons/{slug}/aligned so the default variant remains usable. - When a new request field or template heading changes, update the triage parser's accepted field rules or the issue may receive incomplete labels.
- When flag issue fields or accepted license terms change, keep the flag template and its contributor guidance aligned so reports contain enough evidence for review.
- When issue intake links or blank-issue settings change, keep the available submission and support paths aligned with the issue templates and triage flow.
- When a triage label changes, update the label ownership, stale-issue lane, and auto-merge exclusions together.
- When a lineage pair changes, update both
supersedesandsupersededByfields and keep both slugs in the catalog. - When an SVG rule changes, keep the fast pull-request check, the issue triage check, and the SVGO optimization path aligned so reporters and pull requests do not receive different answers.
- When SVG optimization protection changes, keep the shared license rule, catalog license values, and the explicit skip list aligned so protected artwork is not rewritten.
- When icon or package paths change, keep the version workflow's package map aligned with the packages that publish or re-export the affected catalog.
- When a workflow changes, keep its action syntax and expressions valid so the workflow checks can reach the automation it protects.
- When the pull-request stale policy changes, keep its issue exclusions separate from the triage-label-aware stale policy for icon issues.
- When moderator review routing changes, keep the event types, draft condition, write permission, and CODEOWNERS rules aligned.
- When the
Lint & Buildjob name or required checks change, update the auto-merge conditions and branch protection together so eligible pull requests do not wait forever or bypass a gate. - When the icon statistics output, refresh branch, schedule, concurrency policy, change detection, or token flow changes, update both snapshot workflows and the downstream site data path together.
- When the release window limits, hold label, or release token changes, keep Version PR creation, scheduled merging, and publish-trigger behavior aligned.
- When the CLI release tag or Homebrew tap contract changes, keep the release filter, resolved version, formula name, and tap credentials aligned.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A request uses an existing slug as a new icon request | The request is marked as a duplicate and may follow the wrong update path. | Compare the proposed slug with icons.json and use the update template for an existing icon. |
| A submitted SVG is missing, malformed, too large, or contains unsafe content | The issue receives a blocking triage label or the pull request fails validation. | Supply a raw SVG under 50 KB with a root element, viewBox, and no scripts, handlers, or embedded raster data. |
| A submitted SVG is not optimized | A same-repository pull request receives an automatic cleanup commit, while a fork pull request fails until the contributor updates the asset. | Run npx svgo -f public/icons --multipass locally for fork contributions. |
| An SVG is protected by its license or skip-list status but the protection rules are not applied | SVGO can rewrite artwork that must remain unchanged. | Keep catalog license text, src/…/license-terms.mjs, and scripts/svgo-skip-slugs.json aligned. |
| A request has no usable license source | It cannot receive triage:ready, and the issue can enter the stale flow. | Record a concrete license or brand-use source and keep the brand guidelines link when available. |
| A flag report omits its source or license | Maintainers do not have the required evidence to assess the reported artwork. | Use the flag form and provide links to the SVG and its license. |
| A lineage link names an unknown slug or does not point back | The catalog's version history becomes incomplete or misleading. | Add the reciprocal pair and run node tools/validate-lineage.mjs. |
| A pull request has a ready label but an unresolved blocker or is from a first-time contributor | Auto-merge is not enabled. | Remove the blocker only after review and keep first-time contributions manual. |
| A catalog change uses a path outside the version workflow's package map | The change can merge without a Changeset and therefore without the expected package release. | Update the package map when catalog or package boundaries change. |
| A workflow file contains an actionlint error | The pull request's workflow validation fails before the changed automation can run. | Keep workflow syntax and expressions valid and review the Actionlint check. |
| A pull request stays inactive for 30 days without an exemption | It becomes stale and closes seven days later. | Push a commit or comment, or use an approved exemption label when the work must remain open. |
| A moderator review request is skipped or fails | The shared moderator team is not notified, although required ownership rules still apply. | Treat the request as routing support and keep CODEOWNERS and branch protection as the merge authority. |
| The release window sees a held Version PR or reaches its release cap | The Version PR stays open and changes remain batched for a later release. | Remove hold-release when appropriate or use the force option for an intentional release. |
| The Version PR is merged but a package publish fails | Some packages may publish and tag while the release job still fails, requiring a retry or repair. | Review the publish summary and use the manual publish trigger after fixing the package or registry issue. |
| The PostHog key is missing or rejected | The statistics snapshot fails without replacing the last good file. | Provide a personal key with query-read access and keep the existing snapshot until a valid run succeeds. |
The snapshot job uses GITHUB_TOKEN for its branch push or merge | Downstream workflow events can be blocked by GitHub's anti-recursion rule. | Use the configured personal token for the snapshot branch, pull request, and merge. |
| Two snapshot runs overlap while updating the reusable branch | The branch or pull request can receive competing updates. | Keep the icon-stats-snapshot concurrency group serialized. |
Key files
| File | Why to read it |
|---|---|
| .github/…/check.yml | Main scoped pull-request lint, type, test, build, and stable branch-protection gate. |
| .github/…/actionlint.yml | Pull-request validation for workflow syntax and expressions. |
| .github/…/validate-svg.yml | Fast SVG and catalog data checks, including the current changed-file scope and icon quality gate. |
| scripts/validate-icons.ts | Shared SVG quality rules for publishable and monochrome icon assets. |
| .github/…/svgo.yml | Automatic SVG optimization for repository and fork pull requests. |
| scripts/svgo-protected.mjs and src/…/license-terms.mjs | Shared rules that prevent optimization of protected artwork. |
| .github/…/hygiene.yml | First-time contributor messages and stale pull-request handling. |
| .github/…/config.yml | Issue entry rules and links for web submission, catalog browsing, discussions, and support. |
| .github/…/flag_fix.yml | Structured intake for missing or incorrect country and region flags. |
| .github/…/triage-issue.mjs | Rules that turn issue content into labels and a maintainer summary. |
| .github/…/triage-icon-issue.yml | GitHub actions that apply and refresh triage state. |
| .github/…/stale-icon-issues.yml | Time limits for issues blocked on reporter input. |
| .github/…/labeler.yml and .github/labeler.yml | Path-based pull-request labels. |
| .github/…/request-moderators.yml | Review requests for non-draft pull requests. |
| .github/…/auto-merge-icon-pr.yml | Conditions that enable native squash auto-merge for icon contributions. |
| .github/…/icon-stats-snapshot.yml | Scheduled creation, serialized refresh, change detection, and pull-request delivery of aggregate icon feedback data. |
| .github/…/auto-merge-icon-stats-pr.yml | Conditions that auto-merge the dedicated statistics snapshot pull request. |
| src/…/fetch-icon-stats.ts | Query and safety rules for the static icon feedback snapshot. |
| .github/…/version.yml | Changeset creation and Version PR handoff after catalog changes reach main. |
| .github/…/release-window.yml | Scheduled and manual limits for merging the Version PR. |
| .github/…/release.yml | Package publishing, tagging, and GitHub release creation after the Version PR merges. |
| .github/…/homebrew-tap-update.yml | Release handoff that keeps the CLI formula in the external Homebrew tap current. |
| tools/validate-lineage.mjs | Reciprocal version-link validation for catalog entries. |
| src/…/icons.json | Catalog records whose SVG paths, metadata, and lineage must agree. |
| CONTRIBUTING.md | Contributor-facing catalog and rebrand rules. |