Skip to content
DocsFor version 1.1.x

The submission pipeline

The short version: Automatic submissions, or npm run setup.

Without it, each submission arrives by email from the form service and you turn it into a listing file by hand. With it, the submit form posts to a small function on your host, which checks the submission and opens a pull request with the listing file, ready to review and merge. It’s off by default (submissions.enabled).

What the function does, in order (the code: src/lib/submissions):

  1. Spam: the form’s spam trap, then Cloudflare Turnstile (when you set a site key).
  2. Rate limits: 5 submissions an hour per visitor and 1 a day per website, by default. The visitor’s address comes only from the header your host sets (cf-connecting-ip on Cloudflare; the Netlify and Vercel adapters set CLIENT_IP_HEADER to their own), so a made-up one doesn’t reset the count.
  3. Validation: against the same schema as the listing files. A refused field shows under its field and in the form’s error summary.
  4. Duplicates: the website’s domain is compared with your listings and with the open submission pull requests (each says which website it’s for, in a hidden line of its text). A duplicate gets a link to the listing and to “Request a change”.
  5. The website’s details: it fetches the site, with the protections described under “Security” below, for a logo and the social links. What the submitter typed always wins: fetched values only fill empty fields.
  6. AI suggestions (optional, your own API key): categories, tags, attributes and integrations, chosen only from your own lists, filling only empty fields.
  7. The pull request: one commit on cms/listings/<slug> (the branch the CMS itself would use), made by the pipeline’s GitHub App or machine account (it never names the submitter), with the listing file, its logo and a checklist that names each field as the editor does. Anything to check also goes in the file’s review_notes, including a one-liner or description that’s the website’s own, shortened. Each note is an item of its own in the editor, with its own ×, and once the last is removed the file has no review_notes left. A branch of that name already there is never moved (it could be your own work in the CMS): the next free slug is used instead.
  8. The submitter’s personal details go to you by email, never into the repository. Their name, email address and connection to the listing go to your form service (forms.submit), which emails you as it does today. The email is kept plain, so spam filters are less likely to catch it: one link (to the submission in the editor when the CMS is on, else to the pull request), the website as text, and the submitter as email, so Reply reaches them. Just before it, a private copy of the same details is kept for 90 days in the site’s own store (the rate limits’ RATE_LIMIT KV namespace on Cloudflare, or Upstash elsewhere; src/lib/submissions/submitters.ts), under the listing’s slug, so the editor can show who sent it even if the email lands in the form service’s spam folder (/api/cms/submitter, to signed-in editors only). Without a store, nothing is kept, the email is the only copy, and the editor says so. Only then does the pull request get its labels: submission, plus sveltia-cms/pending_review when the CMS reviews listings (Reviewing in the CMS), so it waits on the CMS’s board under In review. If the email can’t be sent, the stored copy is removed, the pull request is closed and its branch deleted before it’s labelled (the CMS never shows it), and the submitter is asked to try again. A form service the function can’t send to at all (Netlify Forms, or no address) is refused before anything is written.

This keeps personal details out of the repository, so the pipeline is safe for a public repository as well as a private one. The privacy page says the site keeps the copy.

With online checkout on, the submit form has a Make it sponsored (optional) part (SponsorFields, advertise.checkout.withSubmission): a place, its category and a target start. Once the submission is in, its answer carries a pass for the listing, and the visitor goes straight on to the checkout; the thank-you page offers the place again only if that booking didn’t go through. The listing and its sponsorship then wait on the same pull request, and merging it puts both live: Placements and sponsorships → Sponsoring with a submission.

The form’s first step reads the website. With the pipeline on, the submit form opens on the website alone. Continue sends just that address to the same function (/api/submit?details), which first checks for duplicates (your listings, the open submissions, and a website already submitted today): a duplicate is said right there, with its links, before the visitor fills anything in. Otherwise it reads the page’s name, title, description and icon and sends them back. The one-line description is cut at a whole sentence or word (never mid-word, never with “…”), and the longer description gets only text the one-liner didn’t use. The form fills in only the fields that are still empty, then shows the rest with a note saying what was found, for the submitter to check.

The lookup goes through the same checks as a submission: the spam trap, Turnstile, the same fetch protections, and the per-visitor limit, counted separately so a lookup doesn’t use up a submission. Nothing is stored. A Turnstile token works once, so the lookup and sending each have their own: until a button’s token is ready, it says Checking you’re not a robot…, and a press is sent as soon as it is. The check’s box shows only when a visitor has to do something. When the page can’t be read, the robot check didn’t pass, or the visitor’s lookups for the hour are used up, the form goes on with empty fields and a note saying which. With fetchDetails off, or on a host without the function, it goes on with a plain note. Without JavaScript, every field shows from the start.

Merging publishes the listing on the next build (submissions.publishOnMerge, true by default, writes status: published). With the CMS, you review it there: on the Editorial Workflow board under In Review, open it, change anything that needs it and Save, then Publish (which merges it; with One-click publishing off, set its Status to Ready first: Reviewing in the CMS). To merge one without publishing it, change its status to draft first. With publishOnMerge: false, every submission arrives as a draft. To turn a submission down, delete it in the CMS, or close its pull request.

Or as drafts on the branch (submissions.delivery: "draft"). For a CMS without a review workflow:

  • How it arrives: each submission is committed straight to baseBranch with status: draft, so it’s built only in npm run dev and never shown.

  • Reviewing it: the email links to it, and the CMS lists it under To review. Set it to published and save, or delete it.

  • What it costs:

    • Writing to the branch: the pipeline then has to write to the base branch, so its GitHub App must be on the ruleset’s bypass list, and a leaked key could change that branch. The build warns about it.
    • No previews: submissions don’t get a preview.
    • Spam stays: in a public repository, every submission (spam included) stays in the branch’s history even after you delete it.

    The default, "pull-request", keeps the pipeline unable to change the branch, so prefer it unless your CMS can’t review pull requests.

  • The site is in its own GitHub repository, and your host builds it from that repository on every push to main. A merge then publishes the listing.
  • The submit form is connected to Formspree, Web3Forms or a custom endpoint (Forms). The function sends the submitter’s details through it. Netlify Forms doesn’t work for this, because a function can’t send to it. Web3Forms only accepts submissions sent from a server on its paid plans.
  • A host that runs functions. Cloudflare Workers is the default (below). Cloudflare Pages and Netlify have adapters (and Vercel, which works on its paid plans but isn’t officially supported or tested). With none of these, use the import script (“No functions on your host” below).

The function writes to your repository, so it gets the least it needs: it can open pull requests, and a ruleset stops it from merging them or changing main by itself. Only a person (you, as the repository’s admin) merges.

Which protections apply depends on your GitHub plan:

What protects main Public repository (any plan) Private repository, GitHub Free Private repository, Pro, Team or Enterprise
The ruleset below: a pull request with one approval, only the admin role may bypass Yes No. Rulesets on private repositories need a paid plan Yes
The pipeline can open pull requests but not merge them Yes No. Without the ruleset, its write access could merge its own pull request or push to main Yes
The GitHub App’s limits (step 2): one repository, two permissions, tokens that last an hour Yes Yes Yes
The key or token only in your host’s secrets, rotated every few months Yes Yes Yes

Pro is the paid plan for a personal account, Team for an organisation (GitHub Free for organisations has the same limit as Free). On a free private repository the last two rows are the protection: keep the key only in the host’s secrets, rotate it, and revoke it straight away if it might have been exposed (step 2). Upgrade the account that owns the repository if you want the ruleset too.

The ruleset (skip it on a free private repository; GitHub won’t offer it):

  1. In the repository: Settings → Rules → Rulesets → New ruleset → New branch ruleset.
  2. Name it (e.g. “Protect main”), set Enforcement status to Active, and under Target branches choose Add target → Include default branch.
  3. Bypass list → Add bypass → Repository admin, and set it to Always. Add nothing else: not the pipeline’s App, not a machine account, not yourself by name.
    • Admin: you own the repository, so you’re its admin. You can merge without anyone else’s approval, and the CMS (the content editor) can save categories, tags and page copy, which it writes straight to main.
    • Always: use For pull requests only instead if you never save to main directly (no CMS). It’s stricter.
  4. Tick Restrict deletions and Block force pushes.
  5. Tick Require a pull request before merging, and set Required approvals to 1.
    • The pipeline: its pull requests then need you, because an App can’t approve its own pull request.
    • The CMS: moving an entry to Ready approves its pull request on your behalf.
  6. Create.

Then add the labels the pull requests carry: Issues → Labels → New label, named submission, and, with the CMS reviewing listings (Reviewing in the CMS), sveltia-cms/pending_review. Creating them once by hand means the pipeline never needs the right to create labels. Without the label, the pull requests still open, just unlabelled.

Step 2: give the pipeline its own GitHub identity

Section titled “Step 2: give the pipeline its own GitHub identity”

The pipeline writes as a GitHub App (recommended) or as a separate machine account, never as you. Your own token would carry your place on the ruleset’s bypass list, so a leaked copy could publish anything. The App’s pull requests show as <app name>[bot].

The GitHub App (recommended) A token from a separate account
Setup Two clicks with npm run setup:github-app A second GitHub account, an invitation with the Write role, a token
What it can reach One repository, two permissions Everything that account can reach, which should be only this repository
Its token Lasts an hour, made fresh each time Lasts until the expiry date you set, then must be renewed
Pull requests show as <app>[bot] The machine account
Upkeep Rotate the key every few months Renew the token before it expires, or submissions stop
Suits Almost everyone, solo owners included A team that already runs a bot account, or an organisation whose policy doesn’t allow new Apps

Which is quicker? With npm run setup:github-app, usually the App. A second account needs its own email address and an invitation, so the token is only quicker if you already have a machine account. npm run setup refuses a token that belongs to the repository’s owner.

A GitHub App (recommended). It belongs to your account, is installed on this one repository, and the function swaps its key for a token that lasts an hour, limited to that repository and two permissions.

The quickest way: npm run setup:github-app (or npm run setup → Connect GitHub, which makes one app for sign-in, submissions and payments). It opens a page on your computer that sends the App’s settings to GitHub, already filled in. You click Create GitHub App, then Install on this one repository. It then sets the App’s three values on your host, without showing the key or saving it in the project, checks that the App sees only this repository, and creates the labels. The steps below do the same by hand.

  1. On GitHub: your avatar → Settings → Developer settings → GitHub Apps → New GitHub App. For an organisation’s repository: Organization settings → Developer settings → GitHub Apps.

  2. GitHub App name: e.g. “Your Directory submissions” (it must be unique on GitHub). Homepage URL: your site’s address.

  3. Webhook: untick Active. The pipeline doesn’t need GitHub to call it.

  4. Repository permissions:

    • Contents: Read and write;
    • Pull requests: Read and write.

    Metadata: Read-only is added by itself. Nothing else.

  5. Where can this GitHub App be installed? Only on this account.

  6. Create GitHub App, then note the App ID at the top of its page.

  7. Private keys → Generate a private key. GitHub downloads a .pem file. Keep it out of the repository, and somewhere only you can read.

  8. Install App (left menu) → your account → Only select repositories → this one → Install. The installation ID is the number at the end of the page’s address (…/settings/installations/12345678).

  9. Step 5 puts the three values on your host: GITHUB_APP_ID, GITHUB_APP_INSTALLATION_ID, and GITHUB_APP_PRIVATE_KEY (the whole .pem file, BEGIN and END lines included).

Or a machine account’s token. If you’d rather not make an App:

  1. The account: a second GitHub account that exists only for the pipeline. GitHub allows one machine account per person.
  2. Its access: invite it to the repository with the Write role, and add it to nothing else.
  3. Its token:
    • In an organisation’s repository: a fine-grained token, with Resource owner set to the organisation, Only select repositories set to this one, and Contents and Pull requests: Read and write.
    • On a personal account: fine-grained tokens can’t reach another account’s repository, so it’s a classic token with the repo scope. That reaches only what the machine account can, which is this one repository.
    • Either way: set an expiry date.
  4. On your host: the token goes in as GITHUB_TOKEN.

The App wins when both are set.

Rotating and revoking. Replace the key or token every few months, say every three, even if nothing has gone wrong. Put the date in your calendar.

  • To rotate the App’s key: on the App’s page, Private keys → Generate a private key, set the new file as GITHUB_APP_PRIVATE_KEY on the host, send a test submission, then Delete the old key. An App can have several keys at once, so nothing stops working in between.

  • To rotate a machine account’s token: make a new one with the same settings, set it as GITHUB_TOKEN, send a test submission, then delete the old one.

  • To revoke: if a key or token might have been exposed, delete it straight away:

    • The App: delete the key on its page, or suspend its installation (Settings → Applications → Installed GitHub Apps);
    • A machine account: delete the token in that account’s Developer settings.

    Then make a new one and set it on the host. Submissions fail with the generic error until you do, which is safer than leaving a leaked key working. Afterwards, check the repository for branches and pull requests you don’t recognise.

Turnstile is Cloudflare’s free check that a visitor is a person, usually without a puzzle.

  1. In Cloudflare, make a Turnstile widget (Cloudflare’s help), e.g. “Directory submit form”, in Managed mode.
  2. Hostnames: your domain, without https:// (both forms, with and without www.), plus your *.workers.dev address if you test there. A hostname added later takes a few minutes to start working; until then the form says it couldn’t check that the visitor isn’t a robot.
  3. Copy the site key into submissions.turnstileSiteKey (in the editor, Settings → Submissions → Spam check: site key; it’s public). Keep the secret key for step 5.

Without a site key the form still works, but submissions are only rate-limited, and every build warns. Turnstile needs JavaScript, so with it on, a visitor without JavaScript can’t submit. A note at the top of the form says so before they start, with another way to reach you: the email address in your footer (when there is one) and your contact page.

In src/config/directory.config.json:

"submissions": {
"enabled": true,
"endpoint": "/api/submit",
"turnstileSiteKey": "0x4AAAAAAA…",
"repository": "your-account/your-directory",
"baseBranch": "main",
"delivery": "pull-request",
"publishOnMerge": true,
"fetchDetails": true,
"rateLimit": { "perIpPerHour": 5, "perDomainPerDay": 1 },
"ai": { "provider": "off", "model": "", "suggest": ["categories", "tags", "attributes", "integrations"] }
}
  • endpoint: where the form posts. Keep /api/submit unless your host needs another path.
  • repository: owner/repo, where the pull requests go. baseBranch: the branch they start from and merge into.
  • delivery: "pull-request" (the default) or "draft" (see above).
  • fetchDetails: off, and the website isn’t fetched, so no logo or social links are found, and the form’s first step doesn’t read the website. A logo address the submitter gives is still fetched, with the same protections.
  • rateLimit: per visitor per hour, and per website per day. The form’s website lookups have their own count per visitor, at the same hourly limit.
  • ai: see “AI suggestions” below.

What the function says to submitters (duplicates, limits, refused fields) is in src/content/directory/pages/submit.json → form.pipeline. Every message has a default in src/lib/submissions/messages.ts, so you only add the ones you rewrite.

Step 5: deploy on Cloudflare Workers (the default)

Section titled “Step 5: deploy on Cloudflare Workers (the default)”

The site runs as Workers with static assets: Cloudflare serves dist/ as it is, and a small Worker (worker/index.ts) answers only /api/submit.

  1. Copy wrangler.example.jsonc to wrangler.jsonc, and set name and compatibility_date (the day you first deploy).

  2. Rate-limit store (recommended): npx wrangler kv namespace create RATE_LIMIT, then uncomment the kv_namespaces line in wrangler.jsonc and paste the id it printed. Without it, the counts live in the Worker’s memory, which Cloudflare resets often, so the limits only slow down a burst, and no copy of a submitter’s details is kept for the editor (item 8 at the top of this page). For a firmer limit, also add a WAF rate-limiting rule for /api/submit (Security → WAF → Rate limiting rules).

  3. Secrets, one at a time (each asks for the value):

    Terminal window
    npx wrangler secret put GITHUB_APP_ID # the App ID from step 2
    npx wrangler secret put GITHUB_APP_INSTALLATION_ID # the installation ID from step 2
    npx wrangler secret put GITHUB_APP_PRIVATE_KEY < app.pem # the key file from step 2, read from the file
    npx wrangler secret put TURNSTILE_SECRET # the secret key from step 3
    npx wrangler secret put AI_API_KEY # only with AI suggestions on

    The duplicate check needs no secret: each build writes the listings already in your directory, drafts included, into the function’s own code (src/lib/submissions/known-write.ts), never into a public file.

    With a machine account instead of the App: npx wrangler secret put GITHUB_TOKEN. Or use the dashboard: the Worker’s runtime variables, each as type Secret, never plain text, and never copied into wrangler.jsonc (Cloudflare’s help). For the key, paste the whole .pem file.

    Delete the .pem file from the place you downloaded it to once it’s set, or move it somewhere only you can read: the host keeps the copy the function uses.

  4. Deploy: npm run build && npx wrangler deploy. If Cloudflare builds from your repository (Workers Builds), use build command npm run build and deploy command npx wrangler deploy. Add the secrets in the dashboard as in step 3.

  5. Check: the live submit form shows the Turnstile widget, which means submissions are on in the deployed build.

The daily rebuild’s Wrangler option (“The daily rebuild” above) deploys the same wrangler.jsonc, Worker included.

The function is the same everywhere: src/lib/submissions is a (request, env) → Response function that uses only fetch and Web Crypto. Each adapter is a few lines in adapters, written for the place you copy it to:

Host Copy Secrets go in
Cloudflare Pages adapters/cloudflare-pages/functions/api/submit.ts → functions/api/submit.ts Settings → Variables and Secrets. Bind a KV namespace as RATE_LIMIT under Settings → Bindings for the limits
Netlify adapters/netlify/netlify/functions/submit.ts → netlify/functions/submit.ts Site configuration → Environment variables
Vercel adapters/vercel/api/submit.ts → api/submit.ts Project Settings → Environment Variables

The path must match submissions.endpoint: the Pages file’s location gives /api/submit, Netlify’s config.path says it, and Vercel serves api/submit.ts at /api/submit. Rate limits on Netlify and Vercel: set an Upstash Redis database’s UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN (or, on Vercel, add Upstash from the Marketplace, which sets KV_REST_API_URL and KV_REST_API_TOKEN), and the adapters count there (src/lib/server/stores.ts). Without them, each function instance counts on its own. The host’s own rate limiting (Netlify’s rate-limit rules, the Vercel Firewall) adds a firmer limit. Render, or any Node host: the starter’s Node server runs the site and every server feature in one process (Hosting → Render). Render is experimental: until its visitor-address header is confirmed, the rate limits treat every visitor as one, so the submission and checkout limits apply site-wide. For the server features, prefer Cloudflare, Netlify or Vercel. After deploying, check that https://<your site>/api/submit answers Method not allowed (not your 404 page), which means the function is running.

The function asks a model to suggest categories, tags, attributes and integrations for each submission, using your own API key, so you choose the model and pay for it. It sends only the listing’s text and the website’s public text, never the submitter’s details. The model can only answer with your directory’s own slugs, and anything else is thrown away. Suggestions only fill what the submitter left empty. Each one is marked # suggested, check before merging in the file and listed in the pull request’s checklist. A failed call never stops a submission: the pull request says it happened.

"ai": { "provider": "anthropic", "model": "", "suggest": ["categories", "tags", "attributes", "integrations"] }
  • provider: anthropic (your Anthropic API key) or openai (your OpenAI key). off turns them off.
  • model: empty means claude-haiku-5-5 for Anthropic. Choosing from your own lists is a simple task, and you pay per submission, so the smallest current model is the default. For harder judgements (many similar categories, attributes that need reading between the lines), name a larger one: claude-sonnet-5-5, or claude-opus-5-5 for the most careful choices at the highest cost. Larger models also get Anthropic’s server-side fallback, which re-runs a declined request on another model. OpenAI needs a model named here.
  • suggest: which of the four to suggest.
  • The key: the AI_API_KEY secret (step 5).

The privacy page and the editorial policy (src/content/pages/) each have a sentence about this. Keep them if you turn AI on, and take them out if you don’t.

  1. A dry run from your machine: npm run submissions:test -- https://a-real-product.example. It shows what the function would fetch, suggest and write for that website: the listing file and the pull request’s text. It also lists what the setup still needs. Nothing is written or sent.

  2. A test submission on the live site. Submit a real product’s website with your own email address. Within a minute you should have:

    • a pull request on cms/listings/<slug>, labelled submission (and sveltia-cms/pending_review with the CMS), holding one commit with the listing file and its logo;
    • the email from your form service, with the submitter’s details and one link, to the submission in the editor (or the pull request, without the CMS). Not there? Look in the form service’s spam folder: the editor shows the submitter either way.

    Check that the pull request doesn’t contain your name or email address, then close it and delete its branch.

  3. Optional, the live function without writing anything: add the secret SUBMISSIONS_DRY_RUN with the value 1, and a submission then answers with what it would have done (in the browser’s network panel) instead of doing it. Delete the secret afterwards.

If a submission fails, the submitter only sees a generic message. The reason is in the host’s logs: npx wrangler tail on Workers, or the dashboard’s function logs on the other hosts. Look for lines starting [submissions]. They never contain personal details.

Open the pull request. Its checklist lists what to look at: the details against the website, each suggested or fetched value, and the logo. A lettered stand-in logo means none could be used: replace the file. Edit the listing file in the pull request if anything needs changing, then merge. Merging publishes the listing, or leaves it as a draft if its status line says draft. Reply to the submitter from the form service’s email. In the editor, the submission’s card says who sent it (from the stored copy), and the listing’s Tell the submitter button opens /tell-them/ on your site with a ready-written email to them (published, or not accepted), sent from your own email app (Tell them it’s live): the submitter’s details are after the #, never sent to the server, and taken out of the address bar as the page opens. Its wording is the submit page’s tell (submit.json).

Keep your form service as it is (Forms). It emails you each submission, and you import its export now and then:

Terminal window
npm run submissions:import -- export.csv --dry-run # what it would write
npm run submissions:import -- export.csv # a pull request per new listing (the App's variables, or GITHUB_TOKEN, set in your shell)
npm run submissions:import -- export.csv --local # or: a branch per listing in this checkout, to push yourself

For the App, set GITHUB_APP_ID, GITHUB_APP_INSTALLATION_ID and GITHUB_APP_PRIVATE_KEY_PATH (the .pem file’s path, so the key stays in its file) in your shell. It takes the JSON or CSV export from Formspree, Web3Forms or Netlify. Each row is checked, de-duplicated and fetched exactly as the function does it, with AI suggestions if they’re on and AI_API_KEY is set. There’s no Turnstile or rate limit, because the form service already filtered spam. The personal details in the export are never read: keep the file private, and delete it when you’re done. --local needs a clean working tree. It writes each pull request’s text to .astro/submissions/, for you to paste when you open it. --only=3,5 imports only those rows.

  • Secrets are only in the host’s environment: the App’s GITHUB_APP_ID, GITHUB_APP_INSTALLATION_ID and GITHUB_APP_PRIVATE_KEY (or a machine account’s GITHUB_TOKEN), TURNSTILE_SECRET and AI_API_KEY. They’re never in the repository or the config, never logged, and never sent to the browser.

  • The App’s token lasts an hour and can write to one repository only, with two permissions. Where the ruleset applies (step 1), it can open pull requests but never merge them or change main. On a free private repository it could, so the key’s safekeeping is what protects main there.

  • Fetching the submitted website (and any logo address, and the form’s first-step lookup):

    • only http and https, on ports 80 and 443;
    • every host is looked up over DNS over HTTPS and refused unless all its addresses are public (private, loopback, link-local and other reserved ranges are refused, in IPv4 and IPv6);
    • redirects are checked again at each hop, at most 3;
    • 5 seconds per request, at most 1 MB of HTML and 500 KB per image.

    Cloudflare Workers can’t reach private networks in any case. On other hosts these checks are the protection, with one gap: a DNS answer that changes between the check and the request isn’t caught.

  • Fetched content is untrusted:

    • the page is read in one pass that skips scripts, styles and comments;
    • text is stripped of tags and cut to the schema’s lengths;
    • images are accepted only as PNG, JPEG or WebP, recognised by their bytes, with their pixel size capped. A PNG inside an ICO is taken out. SVG is refused, because it can carry scripts.
  • What’s written can’t escape its place:

    • front matter values are JSON-quoted strings, and slugs are checked before they’re written;
    • the description’s HTML is escaped, and only http(s) links are kept;
    • the pull request quotes every received value as code, so it can’t mention anyone or add Markdown.
  • Personal details exist only while the request runs, in the email, and in the site’s store for 90 days (a key per listing, submitter:<slug>, expiring by itself), which only a signed-in editor with write access can read. Visitors’ addresses are kept for the rate limits only as hashes, and only for the hour or day they count. The hashes are salted with a value derived from your site’s secret key (never the key itself); to choose the salt yourself, add a secret RATE_LIMIT_SALT at your host (any long random text).

  • npm run qa:submissions runs the pipeline’s tests with GitHub, Turnstile, the form service, DNS, the AI and websites all mocked. qa:quick runs them when the pipeline changes, and qa:full always does.

  • npm run submissions:e2e runs one submission end to end against a real GitHub test repository, then closes its pull request and deletes the branch. Set TEST_GITHUB_REPO=you/directory-pipeline-test, plus either the test App’s TEST_GITHUB_APP_ID, TEST_GITHUB_APP_INSTALLATION_ID and TEST_GITHUB_APP_PRIVATE_KEY_PATH (the App is used when they’re set; -- --auth=token uses the token instead) or TEST_GITHUB_TOKEN (a token for that repository only). They can live in .env.test, which git ignores. With the App, it also checks the pull request was opened by the App. It says the installation token’s shape (never the token): GitHub’s App installation tokens are now ghs_<app id>_<a JWT>, a few hundred characters with underscores and dots, which the pipeline treats as an opaque string; -- --stateless asks for that format explicitly, with the header GitHub honours until 2026-11-30. It refuses a repository whose name doesn’t say test, sandbox, e2e or scratch, as well as submissions.repository and this checkout’s own remote. Turnstile uses Cloudflare’s always-passing test secret, and the owner’s email is caught instead of sent. Give the test repository a README first: an empty repository has no branch to start from.

  • npm run advertise:e2e runs the Advertise page’s online checkout end to end, in Stripe’s test mode and against the same GitHub test repository:

    1. The booking: it holds a place and creates a real Checkout Session.
    2. The payment: it pays on Stripe’s page with the test card.
    3. The webhook: it posts the paid session to the webhook, as the event Stripe sends, signed locally (no public address or Stripe CLI needed), and checks the pull request.
    4. The refund: it refunds through Stripe, which closes the pull request.
    5. Clean-up.

    Set TEST_STRIPE_SECRET_KEY to a test key (sk_test_… or rk_test_…) with Checkout Sessions: Write, Refunds: Write, PaymentIntents: Read and Charges: Read. It refuses a live key.

  • Stage 3 can point the same core at the D1 moderation queue instead of a pull request.

These docs describe SixtyList 1.1.x.