ci/hostnames: Add PR check for example hostnames - #1878
Draft
marcleblanc2 wants to merge 4 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
marcleblanc2
force-pushed
the
docs/check-example-hostnames
branch
from
September 8, 2026 01:40
1357996 to
89b9448
Compare
Adds dev/check-hostnames.mjs, run from next.config.js alongside the existing link/filename/image checks, so a Vercel preview build (and thus the PR check) fails when docs use a non-canonical placeholder host: - your-sourcegraph-instance.com, sourcegraph.yourcompany.com, sourcegraph.company.com, myinstance.sourcegraph.com, src.example.com, etc. -> sourcegraph.example.com - my-gitlab.example.com, bitbucketserver.example.com, github-enterprise.example.com, *.company.net -> <service>.example.com - any *.sgdev.org (internal Sourcegraph infrastructure) SCHEMA_SYNC blocks and technical-changelog.mdx are skipped, matching the normalization PR. Also fixes the two remaining sgdev.org references the check found. Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <amp@ampcode.com>
…hostnames Generalizes the company-domain rule from a fixed list of code hosts to any host under a fictional company domain (mycompany, yourcompany, company, corp, acme, mydomain, yourdomain), so infra placeholders like grafana.mycompany.com and psql1.mycompany.org are caught too. Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <amp@ampcode.com>
…t build Adds .github/workflows/check-hostnames.yml (on pull_request touching docs/**) and removes the next.config.js hook. The script no longer needs the glob dependency, so the job is checkout + setup-node + node. Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <amp@ampcode.com>
…stnames Suggests example.<saas-domain> (e.g. example.onelogin.com). Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2
force-pushed
the
docs/check-example-hostnames
branch
from
September 8, 2026 01:44
9802af6 to
4c5f1fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1876 (base branch is
docs/normalize-example-hostnames; GitHub will retarget tomainwhen that merges). Do not merge before #1876.What
Adds a GitHub Actions PR check, Example hostnames / Canonical example hostnames (
.github/workflows/check-hostnames.yml), that runs on every pull request touchingdocs/**and fails when a page uses a non-canonical placeholder hostname. The job is checkout +setup-node(version from.tool-versions) +node dev/check-hostnames.mjs; the script has no dependencies so there is no install step. Also runnable locally viapnpm run check-hostnames. It is not wired into the Next build, so Vercel deploys are unaffected.Flagged → suggested:
your-sourcegraph-instance.com,my_sourcegraph.io, …sourcegraph.example.comsourcegraph.yourcompany.com,sourcegraph.your-domain.com,sourcegraph.mycompany.com, …sourcegraph.example.comsourcegraph.company.com,sourcegraph.acme.io,sourcegraph.test:3443,sourcegraph.corpsourcegraph.example.commyinstance.sourcegraph.com,yourinstance.sourcegraph.com,example.sourcegraph.comsourcegraph.example.comsrc.example.com,src.acme.comsourcegraph.example.commy-gitlab.example.com(anymy-*.example.com)gitlab.example.combitbucketserver.example.com,your-bbs-instance.example.combitbucket.example.comgithub-enterprise.example.com,ghe.example.comgithub.example.comsmtp-server.example.comsmtp.example.commycompany.*,yourcompany.*,company.*,corp.*,acme.*,mydomain.*,yourdomain.*— e.g.grafana.mycompany.com,psql1.mycompany.org,github.internal.company.netgrafana.example.com,psql1.example.com,github.internal.example.commycompany.onelogin.com(anymycompany/acme/yourorg… tenant on a real SaaS domain)example.onelogin.com*.sgdev.orgSkipped, matching #1876: auto-generated
SCHEMA_SYNCblocks (fix upstream insourcegraph/sourcegraph) anddocs/technical-changelog.mdx.Output on failure is
docs/<file>:<line>plusfound:/use:so the fix is copy-pasteable.Also in this PR
Two leftover internal hosts the new check caught on top of #1876:
gitlab.sgdev.org/sourcegraph/src-cliinbatch-changes/tracking-existing-changesets.mdxandhttps://cse-k8s.sgdev.org/.api/graphqlincli/explanations/env.mdx.Verification
main(pre-docs/hostnames: Normalize placeholder hostnames to *.example.com #1876):❌ Found 127 non-canonical example hostname(s), exit 1.✅ All example hostnames are canonical!, exit 0.actionlintpasses on the workflow; the script runs green from a directory containing onlydocs/anddev/(nonode_modules).your-sourcegraph-instance.comandmy-gitlab.example.cominto a scratch.mdxfails the check with the expected suggestions.Amp threads