Skip to content

About

Shared Renovate preset and package-update workflows for maintained sites

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

maintenance

What the repos of every project under a maintenance contract share for package updates: the Renovate preset, the smoke test that checks a PR's preview, and the email that tells the client what changed.

Using it in a client repo

renovate.json only extends the preset:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["github>Modular-Everything/maintenance"]
}

.github/workflows/smoke.yml:

name: Smoke test
on:
  pull_request:
    types: [opened, synchronize, reopened]
permissions:
  contents: read
  checks: read
  pull-requests: write
jobs:
  smoke:
    uses: Modular-Everything/maintenance/.github/workflows/smoke.yml@main
    with:
      preview-provider: vercel # or cloudflare-workers, with cloudflare-workers-subdomain
      sitemap: /sitemap-index.xml
      routes: | # pages the sitemap leaves out
        /sanity/admin
      extra-specs: tests/smoke # optional
    secrets: inherit

For Vercel, the repo holds VERCEL_TOKEN, VERCEL_PROJECT_ID, VERCEL_ORG_ID and, behind Deployment Protection, VERCEL_AUTOMATION_BYPASS_SECRET. For Cloudflare Workers, the Worker needs Preview Builds with workers.dev Preview URLs enabled.

Each page must return 2xx, throw no page errors, and have a title and body text. Extra specs are *.spec.ts files that import only @playwright/test and read the preview from PREVIEW_URL. The site itself is never installed.

.github/workflows/notify.yml:

name: Notify client
on:
  pull_request:
    types: [closed]
permissions:
  contents: read
jobs:
  notify:
    uses: Modular-Everything/maintenance/.github/workflows/notify.yml@main
    with:
      client-name: Acme Co
      client-email: client@example.com
      from-email: updates@example.com
    secrets:
      RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}

The email goes out only when the PR was merged, carries the package-update label and changed a top-level package version. Versions come from package-lock.json where there is one, and from package.json otherwise.

Working on it

npm ci
npm run test:unit
npm run validate:renovate
PREVIEW_URL=https://example.com SMOKE_SITEMAP=/sitemap-index.xml npx playwright test --project=smoke

A change to main reaches every client repo on its next run.

About

Shared Renovate preset and package-update workflows for maintained sites

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages