@theholocron/astromech 5.0.0-alpha.251 → 5.0.0-alpha.253
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema.type-
|
|
1
|
+
import { n as TaskEntry, r as TasksConfig, t as TaskConfigItem } from "../schema.type-CHShKm-U.mjs";
|
|
2
2
|
import { Loaded } from "@theholocron/datapad";
|
|
3
3
|
/**
|
|
4
4
|
* The `tasks` config shape — the single manifest of what a repo runs.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as TasksConfig } from "./schema.type-
|
|
1
|
+
import { r as TasksConfig } from "./schema.type-CHShKm-U.mjs";
|
|
2
2
|
import { ListWorkspacePackagesOptions, WorkspacePackageEntry } from "@theholocron/pkg-utils";
|
|
3
3
|
interface WorkspacePackage$1 {
|
|
4
4
|
slug: string;
|
|
@@ -250,6 +250,8 @@ interface RunTaskInput extends RunDeps {
|
|
|
250
250
|
required?: boolean;
|
|
251
251
|
/** `turbo --filter=<pkg>` passthrough (monorepo). Ignored when the repo has no `turbo.json`. */
|
|
252
252
|
filter?: string;
|
|
253
|
+
/** The task entry's `jobs` switches: a sub-job set to `false` (by key or alias) is not run. */
|
|
254
|
+
jobSwitches?: Record<string, boolean>;
|
|
253
255
|
}
|
|
254
256
|
interface RunTaskReport {
|
|
255
257
|
status: "ok" | "fail" | "skip" | "dry-run" | "unknown";
|
|
@@ -613,6 +615,11 @@ interface JobDef {
|
|
|
613
615
|
* jobs) lives in `WORKFLOW_CHECK_CONTEXTS`.
|
|
614
616
|
*/
|
|
615
617
|
checkContext: string;
|
|
618
|
+
/**
|
|
619
|
+
* The name a repo's config uses to switch this job off (`jobs: { packageRegistry: false }`),
|
|
620
|
+
* where the job's own key is vague or fixed by the reusable workflow. The key itself works too.
|
|
621
|
+
*/
|
|
622
|
+
alias?: string;
|
|
616
623
|
}
|
|
617
624
|
interface TaskDef {
|
|
618
625
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -285,7 +285,7 @@ var delivery_previewCheck_default$1 = "name: Preview Check\n\non: # yamllint dis
|
|
|
285
285
|
// src/templates/reusable/delivery.previewDeploy.yml
|
|
286
286
|
var delivery_previewDeploy_default$1 = "name: Preview Deploy\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n cwd:\n description: Directory to run the delivery.previewDeploy task from — the opted-in package's own directory in a monorepo. Defaults to the repo root.\n required: false\n type: string\n default: \".\"\n paths:\n description: >\n JSON array of repo-relative path prefixes (each ending in \"/\") --\n a PR touching none of them skips the actual deploy work instead\n of spinning up a Vercel preview for every PR in the monorepo\n regardless of relevance (holocron#1023). Defaults to an empty\n array: no filter, every PR is relevant -- correct for a\n single-repo consumer, where every PR IS a PR to that package.\n required: false\n type: string\n default: \"[]\"\n secrets:\n VERCEL_TOKEN:\n required: false\n HOLOCRON_DEPLOYMENTS_TOKEN:\n description: >\n A dedicated fine-grained PAT (Deployments: read/write only — see\n docs/tokens.md), not the default GITHUB_TOKEN — GitHub does not\n start a new workflow run for a deployment_status event created\n using a run's own GITHUB_TOKEN, which would make a\n deployment_status-triggered check (e.g. delivery.previewCheck)\n silently never fire. No existing HOLOCRON_<FEATURE>_TOKEN carries\n the Deployments permission, so `secrets: inherit` on the thin\n caller forwards nothing for this unless a repo/org secret\n literally named HOLOCRON_DEPLOYMENTS_TOKEN has been provisioned.\n required: false\n\njobs:\n # Two jobs, deliberately not one: \"report\" never checks out the repo at\n # all, so it never runs a single line of this PR's own code. \"deploy\"\n # does — it has to, to build and stage the preview — and runs with\n # VERCEL_TOKEN present for that (tracked as a residual risk, #1020: the\n # build step still runs this monorepo's own PR-affectable CLI build,\n # pre-review). Without the split, a malicious build/stage script could\n # persist a `gh` shim onto $GITHUB_PATH (or similar runner-state\n # tampering) that a LATER step in the SAME job — the one that finally\n # gets GH_TOKEN — would then execute instead of the real `gh` CLI,\n # stealing that token too. Separate jobs run on separate, fresh\n # runners; \"report\" has nothing of the first job's runner state to\n # inherit.\n deploy:\n name: Deploy preview\n runs-on: ubuntu-latest\n # Setup/build/stage, plus the deploy capability's own\n # wait-for-ready polling (up to 10 minutes by itself) — 10 would kill\n # this before that polling could even finish.\n timeout-minutes: 20\n permissions:\n contents: read\n # Listing the PR's changed files (below, via `gh api`) needs this —\n # must be granted here too, not only on the thin caller: GitHub\n # hard-fails the whole run at startup, zero jobs dispatched, if a\n # called reusable workflow's job asks for more than the caller\n # grants (holocron#1058).\n pull-requests: read\n outputs:\n url: ${{ steps.extract.outputs.url }}\n steps:\n - name: Check whether the PR touches any watched path\n id: filter\n env:\n GH_TOKEN: ${{ github.token }}\n PATHS: ${{ inputs.paths }}\n run: |\n # No checkout needed — the PR's changed-file list comes from the\n # API, not local git history (which this job's later shallow\n # checkout, below, doesn't have enough of to diff against the\n # base branch anyway).\n #\n # `jq -e` both parses PATHS and rejects anything that isn't a\n # JSON array (holocron#1069 review) -- a malformed input (bad\n # JSON, or valid JSON that isn't an array) fails the job loudly\n # instead of the process-substitution loop below silently\n # reading zero prefixes and skipping the deploy with a green\n # check and no explanation.\n paths=$(echo \"$PATHS\" | jq -e 'if type != \"array\" then error(\"paths input is not a JSON array\") else . end') || {\n echo \"::error::delivery.previewDeploy's paths input is not a valid JSON array: $PATHS\"\n exit 1\n }\n # `jq 'length'` on the PARSED value, not a comparison against the\n # literal string \"[]\" -- any valid JSON encoding of an empty\n # array (e.g. \" [ ] \") means the same \"no filter\" thing.\n if [ \"$(echo \"$paths\" | jq 'length')\" = \"0\" ]; then\n echo \"relevant=true\" >> \"$GITHUB_OUTPUT\"\n exit 0\n fi\n # Both the new name AND the old one for a rename -- a file\n # renamed OUT of a watched package (old path matches, new\n # doesn't) is still a real change to that package's tree.\n files=$(gh api \"repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.pull_request.number }}/files\" --paginate --jq '.[] | .filename, (.previous_filename // empty)')\n file_count=$(echo \"$files\" | grep -c . || true)\n if [ \"$file_count\" -ge 3000 ]; then\n # The pulls-files endpoint caps out at 3,000 entries even with\n # --paginate -- past that, a watched path could be among the\n # files we never saw. Can't prove the PR irrelevant, so fail\n # safe to relevant rather than risk silently skipping a real\n # deploy.\n echo \"::warning::PR has >= 3000 changed files -- can't reliably determine path relevance, treating as relevant\"\n echo \"relevant=true\" >> \"$GITHUB_OUTPUT\"\n exit 0\n fi\n relevant=false\n while IFS= read -r prefix; do\n [ -z \"$prefix\" ] && continue\n while IFS= read -r file; do\n [ -z \"$file\" ] && continue\n # Unquoted $prefix (deliberately) -- case pattern-matches it\n # as a glob, anchored at the START of the repo-relative path\n # (holocron#1069 review: grep -F matched the prefix as a\n # literal substring anywhere in the filename, and couldn't\n # match a configured glob like \"custom/**\" at all). The\n # trailing `*` covers a plain directory prefix like\n # \"apps/sentinel/\"; a caller-supplied prefix that already\n # has its own wildcards (e.g. \"custom/**\") just gets one\n # more, harmlessly.\n case \"$file\" in\n $prefix*) relevant=true; break 2 ;;\n esac\n done <<< \"$files\"\n done < <(echo \"$paths\" | jq -r '.[]')\n echo \"relevant=$relevant\" >> \"$GITHUB_OUTPUT\"\n\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n if: ${{ steps.filter.outputs.relevant == 'true' }}\n with:\n # The PR's exact head SHA, not the default pull_request\n # merge-commit ref — what gets built and deployed must be the\n # exact commit the PR actually points at.\n ref: ${{ github.event.pull_request.head.sha }}\n persist-credentials: false\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n if: ${{ steps.filter.outputs.relevant == 'true' }}\n\n - name: Check deploy credentials are available\n if: ${{ steps.filter.outputs.relevant == 'true' }}\n id: creds\n env:\n VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n run: |\n # `secrets` isn't valid in a step `if:` (actionlint-enforced) —\n # a fork PR never receives this secret, so the deploy step below\n # skips cleanly on an empty token instead of failing on a\n # missing credential -- correct, and must stay that way: a\n # fork-triggered pull_request run never gets a write-scoped\n # token either, so there's no way to post a PR comment or check\n # run from here regardless (that needs a separate,\n # pull_request_target-triggered job in the base repo's\n # context -- a real feature with its own review surface, not\n # this step; holocron#1027 explicitly scoped this fix to\n # observability only). The ::notice:: below needs no extra\n # permission -- it's a log annotation the runner itself renders,\n # not an API write -- so it's the cheap half of #1027 that IS\n # worth doing here: a visible, on-PR explanation instead of\n # silence.\n if [ -n \"$VERCEL_TOKEN\" ]; then\n echo \"available=true\" >> \"$GITHUB_OUTPUT\"\n else\n echo \"available=false\" >> \"$GITHUB_OUTPUT\"\n echo \"::notice title=No preview deployed::This run has no VERCEL_TOKEN available, so no preview was deployed -- most commonly because GitHub withholds repository secrets from a pull_request run triggered by a fork, though any run missing this secret ends up here the same way. Since this run creates no deployment, it won't trigger delivery.previewCheck for this PR. A maintainer can deploy one manually if needed.\"\n fi\n\n - name: Deploy preview\n id: deploy\n if: ${{ steps.creds.outputs.available == 'true' }}\n env:\n VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n uses: theholocron/.github/.github/actions/holocron@main\n with:\n command: run delivery.previewDeploy\n args: --cwd=${{ inputs.cwd }}\n\n - name: Extract and validate the preview URL\n id: extract\n # Only after a real deploy — false both when the step above\n # failed and when it skipped cleanly (fork PR, no credential).\n if: ${{ steps.deploy.outcome == 'success' }}\n env:\n LOG_FILE: ${{ steps.deploy.outputs.log-file }}\n run: |\n # A loose https://\\S+ grab would match whatever text follows an\n # attacker-chosen URL this log happens to contain; grabbing\n # candidate text here and separately requiring the PARSED\n # hostname end in .vercel.app (below) closes that regardless of\n # how the candidate text is shaped — e.g. a userinfo trick like\n # \"https://x.vercel.app@127.0.0.1/\" would satisfy almost any\n # hand-written regex character class while actually parsing to\n # host 127.0.0.1, which a naive regex-only check already missed\n # once.\n candidate=$(grep -oE 'https://[^[:space:]\"]+' \"$LOG_FILE\" | tail -1)\n if [ -z \"$candidate\" ]; then\n echo \"::error::deploy succeeded but no https:// URL was found in its output\"\n exit 1\n fi\n host=$(node -e 'try { process.stdout.write(new URL(process.argv[1]).hostname) } catch { process.exit(1) }' \"$candidate\") || host=\"\"\n if [[ \"$host\" != *.vercel.app ]]; then\n echo \"::error::extracted URL '$candidate' does not parse to a *.vercel.app host (parsed host: '${host:-<unparseable>}')\"\n exit 1\n fi\n echo \"url=$candidate\" >> \"$GITHUB_OUTPUT\"\n\n report:\n name: Report deployment status\n needs: deploy\n if: ${{ needs.deploy.outputs.url != '' }}\n runs-on: ubuntu-latest\n timeout-minutes: 5\n permissions:\n deployments: write\n steps:\n - name: Create GitHub deployment and report status\n env:\n # gh reads GH_TOKEN as its auto-auth env var by its own\n # convention -- the secret feeding it is named\n # HOLOCRON_DEPLOYMENTS_TOKEN, matching this org's\n # HOLOCRON_<FEATURE>_TOKEN naming (docs/tokens.md).\n GH_TOKEN: ${{ secrets.HOLOCRON_DEPLOYMENTS_TOKEN }}\n # The PR's head BRANCH, not its SHA — GitHub's PR \"Environments\"\n # widget associates a Deployment with a PR by matching `ref` to\n # the PR's own branch name, not by SHA. GitHub resolves the\n # branch to whatever commit it points to AT CREATION TIME,\n # though, which is a separate moment from the deploy job's own\n # checkout (below, SHA) -- cross-checked after creation rather\n # than assumed.\n REF: ${{ github.event.pull_request.head.ref }}\n # The exact commit the deploy job checked out and built,\n # captured from the same frozen event payload this whole run\n # was triggered by -- stays constant for the run's lifetime\n # even if the PR branch itself moves while this job is running.\n SHA: ${{ github.event.pull_request.head.sha }}\n URL: ${{ needs.deploy.outputs.url }}\n run: |\n if [ -z \"$GH_TOKEN\" ]; then\n echo \"::error::HOLOCRON_DEPLOYMENTS_TOKEN secret is not set -- posting this status with the default GITHUB_TOKEN would not trigger a deployment_status-triggered check\"\n exit 1\n fi\n\n post_status() {\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${deploy_id}/statuses\" \\\n --method POST --field state=\"$1\" --field environment_url=\"$URL\" >/dev/null\n }\n latest_status() {\n gh api \"repos/${GITHUB_REPOSITORY}/deployments/${deploy_id}/statuses\" --jq '.[0].state // empty' 2>/dev/null\n }\n # A deployment this very run may have already created\n # server-side on an earlier attempt whose client-side response\n # got lost (e.g. a dropped connection) -- reused instead of\n # creating a second one, which would leave the first\n # permanently pending (nothing ever posts its status). Scoped\n # to the last 2 minutes so an OLDER deployment for the same\n # ref/environment (a previous, unrelated run) is never\n # mistaken for this one.\n find_recent_deployment() {\n gh api \"repos/${GITHUB_REPOSITORY}/deployments\" --method GET -f ref=\"$REF\" -f environment=Preview --jq '\n [.[] | select((now - (.created_at | fromdateiso8601)) < 120)] | sort_by(.created_at) | last | .id // empty' 2>/dev/null\n }\n\n # jq, not a hand-built string -- a branch name containing a\n # literal double quote (git allows it; GitHub's branch-naming\n # rules don't forbid it either) would otherwise break out of a\n # printf-constructed JSON string and produce an invalid payload\n # gh api can't send.\n payload=$(jq -n --arg ref \"$REF\" '{\n ref: $ref,\n environment: \"Preview\",\n description: \"Vercel Preview (file deploy)\",\n production_environment: false,\n auto_merge: false,\n required_contexts: []\n }')\n deploy_id=\"\"\n for attempt in 1 2 3; do\n deploy_id=$(find_recent_deployment)\n if [ -n \"$deploy_id\" ]; then\n echo \"reusing deployment ${deploy_id} created by an earlier attempt of this run\" >&2\n break\n fi\n deploy_id=$(echo \"$payload\" | gh api \"repos/${GITHUB_REPOSITORY}/deployments\" --method POST --input - | jq -r '.id // empty')\n if [ -n \"$deploy_id\" ]; then break; fi\n echo \"deployment creation failed (attempt ${attempt}/3) -- retrying...\" >&2\n sleep 5\n done\n if [ -z \"$deploy_id\" ]; then\n echo \"::error::failed to create a GitHub deployment after 3 attempts -- Vercel already has the preview, but nothing will report or check it\"\n exit 1\n fi\n\n # `ref` resolves to the branch's CURRENT tip at creation time --\n # only guaranteed to be the commit this job actually built if\n # the branch hasn't moved since the triggering push. A push to\n # the same PR while this job was still running would otherwise\n # silently associate the preview URL (built from the OLD\n # commit) with the NEW commit's deployment. A newer workflow\n # run already covers that new commit (cancel-in-progress:\n # false queues rather than cancels), so failing this stale one\n # loses nothing.\n deployed_sha=$(gh api \"repos/${GITHUB_REPOSITORY}/deployments/${deploy_id}\" --jq '.sha // empty')\n if [ \"$deployed_sha\" != \"$SHA\" ]; then\n echo \"::error::deployment ${deploy_id} resolved to ${deployed_sha}, not the deployed commit ${SHA} -- the PR branch moved while this job was running; a newer run already covers the new commit\"\n exit 1\n fi\n\n for attempt in 1 2 3; do\n if post_status success; then\n exit 0\n fi\n # The POST may have actually succeeded server-side even though\n # this client call reported failure (e.g. a dropped connection\n # after GitHub processed it) — checked before retrying, so a\n # transient client-side error never posts a second success and\n # fires delivery.previewCheck twice for the same preview.\n if [ \"$(latest_status)\" = \"success\" ]; then\n exit 0\n fi\n echo \"status POST failed (attempt ${attempt}/3) for deployment ${deploy_id} -- retrying...\" >&2\n sleep 5\n done\n\n # Exhausted retries — one last attempt to mark the deployment\n # failed rather than leaving it permanently \"pending\" in GitHub's\n # UI; best-effort, its own failure doesn't change this step's\n # already-failed outcome.\n post_status error || true\n echo \"::error::failed to post a success status for deployment ${deploy_id} after 3 attempts -- marked it failed instead of leaving it pending\"\n exit 1\n";
|
|
287
287
|
// src/templates/reusable/delivery.publish.yml
|
|
288
|
-
var delivery_publish_default$1 = "name: Release\n\n# Semantic-release with OIDC Trusted Publishing.\n# actions/setup-node writes a default NODE_AUTH_TOKEN=${{ github.token }}\n# which shadows OIDC auth. We explicitly clear it so npm falls through to\n# the Trusted Publisher OIDC exchange.\n# The calling repo must have a .releaserc.json that configures branches,\n# plugins, and any publish options. npm@11+ is installed to support OIDC.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n dry-run:\n description: >\n When true, runs semantic-release --dry-run: analyzes commits and\n previews the next release without git writes or publish. Only\n meaningful for workflow_dispatch triggers; push-triggered runs\n always run fully.\n type: boolean\n required: false\n default: false\n group:\n description: >\n Version group to release: a folder of the repo (`clients`,\n `observability`). Passed to the release config as RELEASE_GROUP, and\n scopes every tag lookup below to that group's `<group>-v*` tags, so\n releasing one group never reads another's. Empty releases the whole\n repo, with plain `v*` tags. Groups push release commits to the same\n branch, so release them one at a time (a matrix with `max-parallel: 1`);\n each run starts from the branch's current tip, not the commit that\n triggered the workflow.\n type: string\n required: false\n default: \"\"\n post-release:\n description: >\n When true, dispatches a readme sync broadcast after a successful\n release. Enable for packages consumed by other repos via the\n registry-doc system so downstream README installation blocks\n stay current.\n type: boolean\n required: false\n default: false\n run-build:\n description: Run `pnpm build` before releasing\n type: boolean\n required: false\n default: true\n deploy-on-release:\n description: >\n When true, runs a separate `deploy` job after a successful release\n (holocron#930): `holocron deploy on-release` deploys every workspace\n package whose `delivery.deploy` task is `with: { on: release }`, when\n the release is on its channel and changes its paths. The job is its\n own check, re-runnable on its own, and gets VERCEL_TOKEN; the release\n job never sees it. Off by default, so a repo that doesn't deploy from\n its release never exposes the token.\n type: boolean\n required: false\n default: false\n sentry-project:\n description: >\n Sentry project slug for sourcemap upload and release creation after\n publishing. Omit to skip the Sentry release step entirely.\n type: string\n required: false\n default: \"\"\n secrets:\n HOLOCRON_RELEASE_TOKEN:\n description: >\n Fine-grained PAT (Contents + Issues + Pull requests: write) owned by\n an admin. Required when the default branch is protected by a ruleset —\n github.token cannot push through rulesets, but an admin PAT can.\n Takes priority over HOLOCRON_SYNC_TOKEN. Falls back to github.token.\n required: false\n HOLOCRON_SYNC_TOKEN:\n description: >\n Legacy alias for HOLOCRON_RELEASE_TOKEN — kept for backward compatibility.\n Prefer HOLOCRON_RELEASE_TOKEN for new repos.\n required: false\n HOLOCRON_READ_TOKEN:\n description: >\n Fine-grained PAT for read-only GitHub API calls (e.g. resolving git\n committer identity via `gh api user`). Falls back to github.token.\n required: false\n GH_TOKEN:\n description: >\n Generic GitHub token fallback for `gh` CLI calls. Used when\n HOLOCRON_READ_TOKEN is not set.\n required: false\n SENTRY_AUTH_TOKEN:\n description: >\n Sentry auth token for sourcemap upload and release creation.\n Required when sentry-project is set. Use the org-level secret.\n required: false\n TURBO_TOKEN:\n required: false\n VERCEL_TOKEN:\n description: >\n Vercel token for the deploy job. Only used when deploy-on-release is\n true, and only by that job.\n required: false\n\njobs:\n release:\n name: Semantic release\n permissions:\n contents: write\n id-token: write\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n outputs:\n # Read by the deploy job (holocron#930). Empty unless semantic-release\n # published: `commit` is the release commit, `previous` the commit of\n # the release before it (to diff against), `channel` the new version's\n # prerelease identifier (`alpha`), empty for a stable release (`main`).\n commit: ${{ steps.release.outputs.commit }}\n previous: ${{ steps.release.outputs.previous }}\n channel: ${{ steps.release.outputs.channel }}\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n # Do not cancel in-progress releases — a partial release is worse than a slow one.\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n fetch-depth: 0\n persist-credentials: false\n # A group's release commit moves the branch, so a later group's run must\n # release from the branch's current tip, not the commit that triggered the\n # workflow (semantic-release refuses to run behind its remote). Ungrouped,\n # the default (the triggering commit) is unchanged.\n ref: ${{ inputs.group != '' && github.ref || github.sha }}\n # Use HOLOCRON_RELEASE_TOKEN when available — git push (tags, release commits)\n # uses the checkout credential, not GITHUB_TOKEN env var. The\n # built-in github.token cannot push through branch protection rulesets.\n token: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - name: Configure git identity\n run: |\n GIT_NAME=$(gh api user --jq .name 2>/dev/null || echo \"github-actions[bot]\")\n GIT_EMAIL=$(gh api user --jq '\"\\(.id)+\\(.login)@users.noreply.github.com\"' 2>/dev/null || echo \"41898282+github-actions[bot]@users.noreply.github.com\")\n git config --global user.name \"$GIT_NAME\"\n git config --global user.email \"$GIT_EMAIL\"\n git config --global format.signoff true\n env:\n GH_TOKEN: ${{ secrets.HOLOCRON_READ_TOKEN || secrets.GH_TOKEN || github.token }}\n\n - name: Upgrade npm for OIDC support\n run: npm install -g npm@11 sigstore\n # sigstore is required by libnpmpublish/provenance.js at module parse\n # time — before any config takes effect. Some npm 11.x builds stopped\n # bundling it; installing it globally into the same prefix ensures it\n # resolves regardless of npm version. (Discovered 2026-07-09.)\n\n - run: pnpm build\n name: Build\n if: ${{ inputs.run-build == true }}\n\n - name: Release\n id: release\n run: |\n BEFORE=$(git rev-parse HEAD)\n # A group's tags are `<group>-v<version>`; without one, any tag (as before).\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n PREVIOUS_TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || true)\n PREVIOUS=\"\"\n if [ -n \"$PREVIOUS_TAG\" ]; then PREVIOUS=$(git rev-list -n 1 \"$PREVIOUS_TAG\"); fi\n if [ \"$DRY_RUN\" = \"true\" ]; then\n npx semantic-release --dry-run\n else\n npx semantic-release\n fi\n AFTER=$(git rev-parse HEAD)\n # semantic-release only commits (`chore(release): … [skip ci]`) when it\n # actually publishes. That commit gets no CI (and so no coverage\n # upload), which makes the next PR's `codecov/project` compare a full\n # report against a stale ancestor — a phantom drop (holocron#644).\n # Emit the new SHA so the steps below upload coverage for it.\n if [ \"$BEFORE\" != \"$AFTER\" ]; then\n echo \"commit=$AFTER\" >> \"$GITHUB_OUTPUT\"\n echo \"previous=$PREVIOUS\" >> \"$GITHUB_OUTPUT\"\n # The new version's channel: the prerelease identifier of its tag\n # (v5.0.0-alpha.108 or cli-v5.0.0-alpha.108 -> alpha), empty for a stable release.\n VERSION=$(git describe --tags --abbrev=0 \"${MATCH[@]}\")\n VERSION=${VERSION#\"$PREFIX\"}\n CHANNEL=\"\"\n case \"$VERSION\" in *-*) PRE=${VERSION#*-}; CHANNEL=${PRE%%.*} ;; esac\n echo \"channel=$CHANNEL\" >> \"$GITHUB_OUTPUT\"\n fi\n env:\n DRY_RUN: ${{ inputs.dry-run }}\n # Read by the repo's release config to release one version group.\n RELEASE_GROUP: ${{ inputs.group }}\n # Prefer HOLOCRON_RELEASE_TOKEN (fine-grained PAT, Contents+Issues+PRs write,\n # owned by an admin with ruleset bypass) so @semantic-release/git can\n # push the version-bump commit through branch protection. Falls back to\n # HOLOCRON_SYNC_TOKEN (legacy) then github.token for unprotected repos.\n GITHUB_TOKEN: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n HUSKY: \"0\"\n NPM_CONFIG_PROVENANCE: true\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Coverage for the release commit\n if: ${{ steps.release.outputs.commit != '' }}\n with:\n task: verification.unitTests\n\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload release-commit coverage to Codecov\n if: ${{ steps.release.outputs.commit != '' }}\n # fail_ci_if_error makes a failed upload fail this step, so it is visible, but\n # continue-on-error keeps it from failing the job: the release has already\n # published, and the Sentry release steps below must still run (holocron#934).\n continue-on-error: true\n with:\n use_oidc: true\n fail_ci_if_error: true\n override_commit: ${{ steps.release.outputs.commit }}\n override_branch: ${{ github.ref_name }}\n\n - name: Get release version\n id: release_version\n if: ${{ inputs.sentry-project != '' && inputs.dry-run != true }}\n env:\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n RELEASE_GROUP: ${{ inputs.group }}\n run: |\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || echo \"\")\n if [ -n \"$TAG\" ]; then\n echo \"release=${SENTRY_PROJECT}@${TAG#\"$PREFIX\"}\" >> \"$GITHUB_OUTPUT\"\n fi\n\n - name: Create Sentry release\n if: ${{ inputs.sentry-project != '' && steps.release_version.outputs.release != '' && inputs.dry-run != true }}\n uses: getsentry/action-release@ff07929a6537bac57790c3451cf4d364aca38528 # v3\n env:\n SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}\n SENTRY_ORG: theholocron\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n with:\n environment: production\n version: ${{ steps.release_version.outputs.release }}\n sourcemaps: \"**/dist\"\n\n deploy:\n name: Deploy\n needs: release\n # Only after a release that actually published (`commit` is empty on a dry\n # run or when nothing was released). A failed deploy fails only this job:\n # the release is already on npm, and this job re-runs on its own.\n if: ${{ inputs.deploy-on-release == true && inputs.dry-run != true && needs.release.outputs.commit != '' }}\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 30\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout the release commit\n with:\n ref: ${{ needs.release.outputs.commit }}\n fetch-depth: 0\n persist-credentials: false\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Deploy packages that deploy on release\n env:\n VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n with:\n command: deploy on-release\n args: >-\n --channel=${{ needs.release.outputs.channel }}\n --from=${{ needs.release.outputs.previous }}\n --to=${{ needs.release.outputs.commit }}\n\n sync-readme:\n name: Post-release readme sync\n needs: release\n if: ${{ inputs.post-release == true && inputs.dry-run != true }}\n runs-on: ubuntu-latest\n timeout-minutes: 5\n steps:\n - name: Trigger broadcast readme sync\n run: |\n gh workflow run sync-dispatch.yml \\\n --repo theholocron/.github \\\n --field \"steps=readme\"\n env:\n GH_TOKEN: ${{ secrets.HOLOCRON_SYNC_TOKEN || secrets.GH_TOKEN }}\n";
|
|
288
|
+
var delivery_publish_default$1 = "name: Release\n\n# Semantic-release with OIDC Trusted Publishing.\n# actions/setup-node writes a default NODE_AUTH_TOKEN=${{ github.token }}\n# which shadows OIDC auth. We explicitly clear it so npm falls through to\n# the Trusted Publisher OIDC exchange.\n# The calling repo must have a .releaserc.json that configures branches,\n# plugins, and any publish options. npm@11+ is installed to support OIDC.\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n inputs:\n dry-run:\n description: >\n When true, runs semantic-release --dry-run: analyzes commits and\n previews the next release without git writes or publish. Only\n meaningful for workflow_dispatch triggers; push-triggered runs\n always run fully.\n type: boolean\n required: false\n default: false\n group:\n description: >\n Version group to release: a folder of the repo (`clients`,\n `observability`). Passed to the release config as RELEASE_GROUP, and\n scopes every tag lookup below to that group's `<group>-v*` tags, so\n releasing one group never reads another's. Empty releases the whole\n repo, with plain `v*` tags. Groups push release commits to the same\n branch, so release them one at a time (a matrix with `max-parallel: 1`);\n each run starts from the branch's current tip, not the commit that\n triggered the workflow.\n type: string\n required: false\n default: \"\"\n from-branch-tip:\n description: >\n When true, an ungrouped release starts from the branch's current tip\n instead of the commit that triggered the workflow. Set it when the\n repo-wide release runs after the version groups, whose release\n commits have moved the branch (semantic-release refuses to run\n behind its remote). A group always starts from the tip.\n type: boolean\n required: false\n default: false\n post-release:\n description: >\n When true, dispatches a readme sync broadcast after a successful\n release. Enable for packages consumed by other repos via the\n registry-doc system so downstream README installation blocks\n stay current.\n type: boolean\n required: false\n default: false\n run-build:\n description: Run `pnpm build` before releasing\n type: boolean\n required: false\n default: true\n deploy-on-release:\n description: >\n When true, runs a separate `deploy` job after a successful release\n (holocron#930): `holocron deploy on-release` deploys every workspace\n package whose `delivery.deploy` task is `with: { on: release }`, when\n the release is on its channel and changes its paths. The job is its\n own check, re-runnable on its own, and gets VERCEL_TOKEN; the release\n job never sees it. Off by default, so a repo that doesn't deploy from\n its release never exposes the token.\n type: boolean\n required: false\n default: false\n sentry-project:\n description: >\n Sentry project slug for sourcemap upload and release creation after\n publishing. Omit to skip the Sentry release step entirely.\n type: string\n required: false\n default: \"\"\n secrets:\n HOLOCRON_RELEASE_TOKEN:\n description: >\n Fine-grained PAT (Contents + Issues + Pull requests: write) owned by\n an admin. Required when the default branch is protected by a ruleset —\n github.token cannot push through rulesets, but an admin PAT can.\n Takes priority over HOLOCRON_SYNC_TOKEN. Falls back to github.token.\n required: false\n HOLOCRON_SYNC_TOKEN:\n description: >\n Legacy alias for HOLOCRON_RELEASE_TOKEN — kept for backward compatibility.\n Prefer HOLOCRON_RELEASE_TOKEN for new repos.\n required: false\n HOLOCRON_READ_TOKEN:\n description: >\n Fine-grained PAT for read-only GitHub API calls (e.g. resolving git\n committer identity via `gh api user`). Falls back to github.token.\n required: false\n GH_TOKEN:\n description: >\n Generic GitHub token fallback for `gh` CLI calls. Used when\n HOLOCRON_READ_TOKEN is not set.\n required: false\n SENTRY_AUTH_TOKEN:\n description: >\n Sentry auth token for sourcemap upload and release creation.\n Required when sentry-project is set. Use the org-level secret.\n required: false\n TURBO_TOKEN:\n required: false\n VERCEL_TOKEN:\n description: >\n Vercel token for the deploy job. Only used when deploy-on-release is\n true, and only by that job.\n required: false\n\njobs:\n release:\n name: Semantic release\n permissions:\n contents: write\n id-token: write\n issues: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 30\n outputs:\n # Read by the deploy job (holocron#930). Empty unless semantic-release\n # published: `commit` is the release commit, `previous` the commit of\n # the release before it (to diff against), `channel` the new version's\n # prerelease identifier (`alpha`), empty for a stable release (`main`).\n commit: ${{ steps.release.outputs.commit }}\n previous: ${{ steps.release.outputs.previous }}\n channel: ${{ steps.release.outputs.channel }}\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n # Do not cancel in-progress releases — a partial release is worse than a slow one.\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout repository\n with:\n fetch-depth: 0\n persist-credentials: false\n # A group's release commit moves the branch, so a later group's run must\n # release from the branch's current tip, not the commit that triggered the\n # workflow (semantic-release refuses to run behind its remote). Ungrouped,\n # the default (the triggering commit) is unchanged, unless `from-branch-tip`\n # says the groups ran first.\n ref: ${{ (inputs.group != '' || inputs.from-branch-tip) && github.ref || github.sha }}\n # Use HOLOCRON_RELEASE_TOKEN when available — git push (tags, release commits)\n # uses the checkout credential, not GITHUB_TOKEN env var. The\n # built-in github.token cannot push through branch protection rulesets.\n token: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - name: Configure git identity\n run: |\n GIT_NAME=$(gh api user --jq .name 2>/dev/null || echo \"github-actions[bot]\")\n GIT_EMAIL=$(gh api user --jq '\"\\(.id)+\\(.login)@users.noreply.github.com\"' 2>/dev/null || echo \"41898282+github-actions[bot]@users.noreply.github.com\")\n git config --global user.name \"$GIT_NAME\"\n git config --global user.email \"$GIT_EMAIL\"\n git config --global format.signoff true\n env:\n GH_TOKEN: ${{ secrets.HOLOCRON_READ_TOKEN || secrets.GH_TOKEN || github.token }}\n\n - name: Upgrade npm for OIDC support\n run: npm install -g npm@11 sigstore\n # sigstore is required by libnpmpublish/provenance.js at module parse\n # time — before any config takes effect. Some npm 11.x builds stopped\n # bundling it; installing it globally into the same prefix ensures it\n # resolves regardless of npm version. (Discovered 2026-07-09.)\n\n - run: pnpm build\n name: Build\n if: ${{ inputs.run-build == true }}\n\n - name: Release\n id: release\n run: |\n BEFORE=$(git rev-parse HEAD)\n # A group's tags are `<group>-v<version>`; without one, any tag (as before).\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n PREVIOUS_TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || true)\n PREVIOUS=\"\"\n if [ -n \"$PREVIOUS_TAG\" ]; then PREVIOUS=$(git rev-list -n 1 \"$PREVIOUS_TAG\"); fi\n if [ \"$DRY_RUN\" = \"true\" ]; then\n npx semantic-release --dry-run\n else\n npx semantic-release\n fi\n AFTER=$(git rev-parse HEAD)\n # semantic-release only commits (`chore(release): … [skip ci]`) when it\n # actually publishes. That commit gets no CI (and so no coverage\n # upload), which makes the next PR's `codecov/project` compare a full\n # report against a stale ancestor — a phantom drop (holocron#644).\n # Emit the new SHA so the steps below upload coverage for it.\n if [ \"$BEFORE\" != \"$AFTER\" ]; then\n echo \"commit=$AFTER\" >> \"$GITHUB_OUTPUT\"\n echo \"previous=$PREVIOUS\" >> \"$GITHUB_OUTPUT\"\n # The new version's channel: the prerelease identifier of its tag\n # (v5.0.0-alpha.108 or cli-v5.0.0-alpha.108 -> alpha), empty for a stable release.\n VERSION=$(git describe --tags --abbrev=0 \"${MATCH[@]}\")\n VERSION=${VERSION#\"$PREFIX\"}\n CHANNEL=\"\"\n case \"$VERSION\" in *-*) PRE=${VERSION#*-}; CHANNEL=${PRE%%.*} ;; esac\n echo \"channel=$CHANNEL\" >> \"$GITHUB_OUTPUT\"\n fi\n env:\n DRY_RUN: ${{ inputs.dry-run }}\n # Read by the repo's release config to release one version group.\n RELEASE_GROUP: ${{ inputs.group }}\n # Prefer HOLOCRON_RELEASE_TOKEN (fine-grained PAT, Contents+Issues+PRs write,\n # owned by an admin with ruleset bypass) so @semantic-release/git can\n # push the version-bump commit through branch protection. Falls back to\n # HOLOCRON_SYNC_TOKEN (legacy) then github.token for unprotected repos.\n GITHUB_TOKEN: ${{ secrets.HOLOCRON_RELEASE_TOKEN || secrets.HOLOCRON_SYNC_TOKEN || github.token }}\n HUSKY: \"0\"\n NPM_CONFIG_PROVENANCE: true\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Coverage for the release commit\n if: ${{ steps.release.outputs.commit != '' }}\n with:\n task: verification.unitTests\n\n - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0\n name: Upload release-commit coverage to Codecov\n if: ${{ steps.release.outputs.commit != '' }}\n # fail_ci_if_error makes a failed upload fail this step, so it is visible, but\n # continue-on-error keeps it from failing the job: the release has already\n # published, and the Sentry release steps below must still run (holocron#934).\n continue-on-error: true\n with:\n use_oidc: true\n fail_ci_if_error: true\n override_commit: ${{ steps.release.outputs.commit }}\n override_branch: ${{ github.ref_name }}\n\n - name: Get release version\n id: release_version\n if: ${{ inputs.sentry-project != '' && inputs.dry-run != true }}\n env:\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n RELEASE_GROUP: ${{ inputs.group }}\n run: |\n MATCH=()\n PREFIX=\"v\"\n if [ -n \"$RELEASE_GROUP\" ]; then\n MATCH=(--match \"${RELEASE_GROUP}-v*\")\n PREFIX=\"${RELEASE_GROUP}-v\"\n fi\n TAG=$(git describe --tags --abbrev=0 \"${MATCH[@]}\" 2>/dev/null || echo \"\")\n if [ -n \"$TAG\" ]; then\n echo \"release=${SENTRY_PROJECT}@${TAG#\"$PREFIX\"}\" >> \"$GITHUB_OUTPUT\"\n fi\n\n - name: Create Sentry release\n if: ${{ inputs.sentry-project != '' && steps.release_version.outputs.release != '' && inputs.dry-run != true }}\n uses: getsentry/action-release@ff07929a6537bac57790c3451cf4d364aca38528 # v3\n env:\n SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}\n SENTRY_ORG: theholocron\n SENTRY_PROJECT: ${{ inputs.sentry-project }}\n with:\n environment: production\n version: ${{ steps.release_version.outputs.release }}\n sourcemaps: \"**/dist\"\n\n deploy:\n name: Deploy\n needs: release\n # Only after a release that actually published (`commit` is empty on a dry\n # run or when nothing was released). A failed deploy fails only this job:\n # the release is already on npm, and this job re-runs on its own.\n if: ${{ inputs.deploy-on-release == true && inputs.dry-run != true && needs.release.outputs.commit != '' }}\n permissions:\n contents: read\n runs-on: ubuntu-latest\n timeout-minutes: 30\n env:\n TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}\n TURBO_TEAM: ${{ vars.TURBO_TEAM }}\n steps:\n - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0\n name: Checkout the release commit\n with:\n ref: ${{ needs.release.outputs.commit }}\n fetch-depth: 0\n persist-credentials: false\n\n - uses: theholocron/.github/.github/actions/setup@main\n name: Setup\n\n - uses: theholocron/.github/.github/actions/holocron@main\n name: Deploy packages that deploy on release\n env:\n VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n with:\n command: deploy on-release\n args: >-\n --channel=${{ needs.release.outputs.channel }}\n --from=${{ needs.release.outputs.previous }}\n --to=${{ needs.release.outputs.commit }}\n\n sync-readme:\n name: Post-release readme sync\n needs: release\n if: ${{ inputs.post-release == true && inputs.dry-run != true }}\n runs-on: ubuntu-latest\n timeout-minutes: 5\n steps:\n - name: Trigger broadcast readme sync\n run: |\n gh workflow run sync-dispatch.yml \\\n --repo theholocron/.github \\\n --field \"steps=readme\"\n env:\n GH_TOKEN: ${{ secrets.HOLOCRON_SYNC_TOKEN || secrets.GH_TOKEN }}\n";
|
|
289
289
|
// src/templates/reusable/dependencies.yml
|
|
290
290
|
var dependencies_default$1 = "name: Dependencies\n\non: # yamllint disable-line rule:truthy\n workflow_call:\n secrets:\n merge-token:\n description: >\n Optional privileged token for auto-merge. Falls back to GITHUB_TOKEN.\n Required when branch protection enforces required reviews — GITHUB_TOKEN\n cannot approve its own PRs.\n required: false\n\njobs:\n dependabot:\n name: Update the dependencies\n permissions:\n contents: write\n pull-requests: write\n runs-on: ubuntu-latest\n timeout-minutes: 5\n if: github.event.pull_request.user.login == 'dependabot[bot]'\n steps:\n - uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0\n name: Fetch Dependabot metadata\n id: metadata\n\n - run: gh pr merge --auto --squash \"$PR_URL\"\n # --squash is intentional: repo protection sets allow_merge_commit: false,\n # so --merge would fail on any repo using the standard preset.\n name: Enable auto-merge for Dependabot PRs\n if: steps.metadata.outputs.update-type == 'version-update:semver-patch'\n env:\n PR_URL: ${{ github.event.pull_request.html_url }}\n GH_TOKEN: ${{ secrets.merge-token || github.token }}\n";
|
|
291
291
|
// src/templates/reusable/greetings.yml
|
|
@@ -456,9 +456,15 @@ function parseGroups(groups) {
|
|
|
456
456
|
* - A push releases every group; a manual run can pick one (and dry-run it) with the
|
|
457
457
|
* `group` input. A job's `if:` cannot see `matrix`, so the choice is made in `plan`.
|
|
458
458
|
* - `ungrouped` also releases everything that is in **no** group, together and under the
|
|
459
|
-
* repo's plain tags, as the single release did before; it runs
|
|
460
|
-
*
|
|
461
|
-
*
|
|
459
|
+
* repo's plain tags, as the single release did before; it runs **last**, from the branch's
|
|
460
|
+
* current tip (`from-branch-tip`), once every group has released. Packages in no group
|
|
461
|
+
* depend on the groups' packages through `workspace:` ranges, which are rewritten to
|
|
462
|
+
* concrete versions at publish time, so the groups must be on npm first; list `groups` in
|
|
463
|
+
* dependency order (a group before the groups that depend on it). It is skipped if a group
|
|
464
|
+
* failed, so a failed dependency does not leave a package published against a version
|
|
465
|
+
* that is not on npm. It takes the same per-release inputs as a group (`true` for none).
|
|
466
|
+
* A repo with groups and packages in no group needs it, or those packages would stop
|
|
467
|
+
* releasing.
|
|
462
468
|
* - `shared` entries (and the template's own `dry-run`) go to every release; the
|
|
463
469
|
* per-group inputs come from the matrix entry.
|
|
464
470
|
*/
|
|
@@ -499,18 +505,22 @@ function groupedPublishCaller(base, groups, shared, ungrouped = false) {
|
|
|
499
505
|
const ungroupedJob = ungroupedInputs ? [
|
|
500
506
|
" release:",
|
|
501
507
|
" name: Release",
|
|
502
|
-
"
|
|
508
|
+
" # last: the packages in no group depend on the groups' packages, which must be on npm first.",
|
|
509
|
+
" # Runs even if the groups were skipped (a manual run picked `ungrouped`), but not if one failed.",
|
|
510
|
+
" needs: [plan, release-groups]",
|
|
511
|
+
" if: >-",
|
|
512
|
+
" ${{ !cancelled() && needs.plan.result == 'success' && needs.release-groups.result != 'failure' &&",
|
|
513
|
+
" (inputs.group == '' || inputs.group == 'all' || inputs.group == 'ungrouped') }}",
|
|
503
514
|
uses,
|
|
504
515
|
" with:",
|
|
505
516
|
...templateWith,
|
|
517
|
+
" from-branch-tip: true",
|
|
506
518
|
...sharedWith,
|
|
507
519
|
...Object.entries(ungroupedInputs).map(([key, value]) => ` ${key}: ${yamlScalar(value)}`),
|
|
508
|
-
" secrets: inherit"
|
|
509
|
-
""
|
|
520
|
+
" secrets: inherit"
|
|
510
521
|
] : [];
|
|
511
522
|
return [
|
|
512
523
|
`${head}jobs:`,
|
|
513
|
-
...ungroupedJob,
|
|
514
524
|
" plan:",
|
|
515
525
|
" name: Plan",
|
|
516
526
|
" runs-on: ubuntu-latest",
|
|
@@ -534,10 +544,9 @@ function groupedPublishCaller(base, groups, shared, ungrouped = false) {
|
|
|
534
544
|
` ${ungroupedInputs ? "release-groups" : "release"}:`,
|
|
535
545
|
" name: Release ${{ matrix.group }}",
|
|
536
546
|
...ungroupedInputs ? [
|
|
537
|
-
" # after the ungrouped release, which pushes its own commit first; still run if it failed or was skipped.",
|
|
538
547
|
" # Choosing `ungrouped` by hand leaves the plan empty, and a matrix with no entries fails the run.",
|
|
539
|
-
" needs:
|
|
540
|
-
" if: ${{
|
|
548
|
+
" needs: plan",
|
|
549
|
+
" if: ${{ needs.plan.outputs.groups != '[]' }}"
|
|
541
550
|
] : [" needs: plan"],
|
|
542
551
|
" strategy:",
|
|
543
552
|
" fail-fast: false",
|
|
@@ -548,6 +557,7 @@ function groupedPublishCaller(base, groups, shared, ungrouped = false) {
|
|
|
548
557
|
" with:",
|
|
549
558
|
...matrixWith,
|
|
550
559
|
" secrets: inherit",
|
|
560
|
+
...ungroupedJob.length > 0 ? ["", ...ungroupedJob] : [],
|
|
551
561
|
""
|
|
552
562
|
].join("\n");
|
|
553
563
|
}
|
|
@@ -1005,7 +1015,11 @@ const TASKS = {
|
|
|
1005
1015
|
"eslint.config.ts",
|
|
1006
1016
|
"eslint.config.js",
|
|
1007
1017
|
"eslint.config.mjs",
|
|
1008
|
-
"eslint.config.cjs"
|
|
1018
|
+
"eslint.config.cjs",
|
|
1019
|
+
"$TURBO_ROOT$/eslint.config.ts",
|
|
1020
|
+
"$TURBO_ROOT$/eslint.config.js",
|
|
1021
|
+
"$TURBO_ROOT$/eslint.config.mjs",
|
|
1022
|
+
"$TURBO_ROOT$/eslint.config.cjs"
|
|
1009
1023
|
],
|
|
1010
1024
|
outputs: [],
|
|
1011
1025
|
dependsOn: ["^delivery.build"]
|
|
@@ -1056,6 +1070,7 @@ const TASKS = {
|
|
|
1056
1070
|
"src/**",
|
|
1057
1071
|
"package.json",
|
|
1058
1072
|
"tsdown.config.ts",
|
|
1073
|
+
"$TURBO_ROOT$/tsdown.config.ts",
|
|
1059
1074
|
"vite.config.ts",
|
|
1060
1075
|
"rollup.config.ts",
|
|
1061
1076
|
"tsconfig.json"
|
|
@@ -1097,14 +1112,16 @@ const TASKS = {
|
|
|
1097
1112
|
tool: "node",
|
|
1098
1113
|
args: ["scripts/validate-registry.mjs"]
|
|
1099
1114
|
},
|
|
1100
|
-
checkContext: "platform.repoValidation / Validate registry consistency"
|
|
1115
|
+
checkContext: "platform.repoValidation / Validate registry consistency",
|
|
1116
|
+
alias: "packageRegistry"
|
|
1101
1117
|
},
|
|
1102
1118
|
docsPresence: {
|
|
1103
1119
|
local: {
|
|
1104
1120
|
tool: "node",
|
|
1105
1121
|
args: ["scripts/validate-docs-presence.mjs"]
|
|
1106
1122
|
},
|
|
1107
|
-
checkContext: "platform.repoValidation / Validate docs presence"
|
|
1123
|
+
checkContext: "platform.repoValidation / Validate docs presence",
|
|
1124
|
+
alias: "docsEnforcement"
|
|
1108
1125
|
}
|
|
1109
1126
|
}
|
|
1110
1127
|
},
|
|
@@ -1891,6 +1908,11 @@ function makeRunOne(input) {
|
|
|
1891
1908
|
};
|
|
1892
1909
|
};
|
|
1893
1910
|
}
|
|
1911
|
+
/** `false` when the repo's config switched this sub-job off, by its key or its alias. */
|
|
1912
|
+
function jobEnabled(name, jobDef, switches) {
|
|
1913
|
+
if (!switches) return true;
|
|
1914
|
+
return switches[name] !== false && (jobDef.alias === void 0 || switches[jobDef.alias] !== false);
|
|
1915
|
+
}
|
|
1894
1916
|
function runTask(input) {
|
|
1895
1917
|
const { print, logger, readFile, fileExists, listDir, task, cwd } = input;
|
|
1896
1918
|
const def = TASKS[task];
|
|
@@ -1916,6 +1938,19 @@ function runTask(input) {
|
|
|
1916
1938
|
};
|
|
1917
1939
|
}
|
|
1918
1940
|
const label = `${task} ${job}`;
|
|
1941
|
+
if (!jobEnabled(job, jobDef, input.jobSwitches)) {
|
|
1942
|
+
const message = `${label} is off in this repo's config (jobs.${jobDef.alias ?? job}: false)`;
|
|
1943
|
+
print(`· ${message}`);
|
|
1944
|
+
logger.debug({
|
|
1945
|
+
task,
|
|
1946
|
+
job,
|
|
1947
|
+
status: "skip"
|
|
1948
|
+
}, `run: ${label}`);
|
|
1949
|
+
return {
|
|
1950
|
+
status: "skip",
|
|
1951
|
+
message
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1919
1954
|
return runUnit(input, label, jobDef.local, makeRunOne({
|
|
1920
1955
|
...input,
|
|
1921
1956
|
task: label
|
|
@@ -2055,6 +2090,10 @@ function runAllJobs(input, jobs, passthrough) {
|
|
|
2055
2090
|
const reports = [];
|
|
2056
2091
|
for (const [name, jobDef] of Object.entries(jobs)) {
|
|
2057
2092
|
const label = `${task} ${name}`;
|
|
2093
|
+
if (!jobEnabled(name, jobDef, input.jobSwitches)) {
|
|
2094
|
+
print(`· ${jobDef.checkContext} — off in this repo's config (jobs.${jobDef.alias ?? name}: false)`);
|
|
2095
|
+
continue;
|
|
2096
|
+
}
|
|
2058
2097
|
print(`▶ ${jobDef.checkContext}`);
|
|
2059
2098
|
reports.push(runUnit(perJob, label, jobDef.local, makeRunOne({
|
|
2060
2099
|
...perJob,
|
|
@@ -2199,6 +2238,7 @@ function runCi(input) {
|
|
|
2199
2238
|
listDir: input.listDir,
|
|
2200
2239
|
lookPath: input.lookPath,
|
|
2201
2240
|
task: entry.name,
|
|
2241
|
+
...entry.jobs ? { jobSwitches: entry.jobs } : {},
|
|
2202
2242
|
cwd: input.cwd,
|
|
2203
2243
|
dryRun: input.dryRun ?? false,
|
|
2204
2244
|
required: entry.required === true,
|
|
@@ -2638,6 +2678,11 @@ function matchNamespace(config, namespace) {
|
|
|
2638
2678
|
* the rest, same as `runCi`'s own loop — so a single invocation surfaces
|
|
2639
2679
|
* every problem in the namespace at once instead of stopping at the first.
|
|
2640
2680
|
*/
|
|
2681
|
+
/** The `jobs` switches of a task's entry, as a `runTask` input; nothing when it has none. */
|
|
2682
|
+
function jobSwitches(config, name) {
|
|
2683
|
+
const jobs = config.tasks.map(normalizeTaskEntry).find((e) => e.name === name)?.jobs;
|
|
2684
|
+
return jobs ? { jobSwitches: jobs } : {};
|
|
2685
|
+
}
|
|
2641
2686
|
function runGroup(input) {
|
|
2642
2687
|
const { print, namespace } = input;
|
|
2643
2688
|
const names = matchNamespace(input.config, namespace);
|
|
@@ -2659,6 +2704,7 @@ function runGroup(input) {
|
|
|
2659
2704
|
listDir: input.listDir,
|
|
2660
2705
|
lookPath: input.lookPath,
|
|
2661
2706
|
task: name,
|
|
2707
|
+
...jobSwitches(input.config, name),
|
|
2662
2708
|
cwd: input.cwd,
|
|
2663
2709
|
dryRun: input.dryRun ?? false,
|
|
2664
2710
|
...input.filter ? { filter: input.filter } : {}
|
|
@@ -2692,6 +2738,11 @@ function createAstromech(options) {
|
|
|
2692
2738
|
lookPath: options.lookPath ?? realLookPath
|
|
2693
2739
|
};
|
|
2694
2740
|
const items = () => (options.config?.tasks ?? []).map((i) => normalizeTaskEntry(i));
|
|
2741
|
+
/** The `jobs` switches of a task's entry in the manifest, as a `runTask` input; nothing when it has none. */
|
|
2742
|
+
const jobSwitchesFor = (task) => {
|
|
2743
|
+
const jobs = items().find((e) => e.name === task)?.jobs;
|
|
2744
|
+
return jobs ? { jobSwitches: jobs } : {};
|
|
2745
|
+
};
|
|
2695
2746
|
/**
|
|
2696
2747
|
* Task names this repo's manifest can actually run locally — shared by
|
|
2697
2748
|
* {@link packageScripts} and by `holocron`'s own interactive task picker.
|
|
@@ -2729,7 +2780,8 @@ function createAstromech(options) {
|
|
|
2729
2780
|
passthrough: opts.passthrough ?? [],
|
|
2730
2781
|
dryRun: opts.dryRun ?? false,
|
|
2731
2782
|
required: opts.required ?? false,
|
|
2732
|
-
...opts.filter ? { filter: opts.filter } : {}
|
|
2783
|
+
...opts.filter ? { filter: opts.filter } : {},
|
|
2784
|
+
...jobSwitchesFor(task)
|
|
2733
2785
|
});
|
|
2734
2786
|
},
|
|
2735
2787
|
ci: (opts = {}) => runCi({
|
package/dist/release/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as TasksConfig } from "../schema.type-
|
|
1
|
+
import { r as TasksConfig } from "../schema.type-CHShKm-U.mjs";
|
|
2
2
|
import { defineConfig } from "@theholocron/semantic-release-config";
|
|
3
3
|
/** Runs `git` with `args` in `cwd`, feeding it `input` on stdin, and returns stdout. */
|
|
4
4
|
export type GitRun = (args: string[], input: string, cwd: string) => string;
|
|
@@ -20,6 +20,12 @@ interface TaskEntry {
|
|
|
20
20
|
required?: boolean;
|
|
21
21
|
/** Per-repo overrides on the same channel the reusable workflow reads. */
|
|
22
22
|
with?: Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Switch individual sub-jobs of a task off for this repo (`false`), by their registry key or alias:
|
|
25
|
+
* `{ name: "platform.repoValidation", jobs: { packageRegistry: false } }`. A job left out runs. The job's CI
|
|
26
|
+
* check still reports (green, "off in this repo's config"), so a required check never goes missing.
|
|
27
|
+
*/
|
|
28
|
+
jobs?: Record<string, boolean>;
|
|
23
29
|
/** Extra `on.push.paths` entries for the generated CI workflow. */
|
|
24
30
|
paths?: string[];
|
|
25
31
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/astromech",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.253",
|
|
4
4
|
"description": "The Holocron task runner — one task manifest drives `holocron run`, `holocron run ci`, the CI workflows, package.json scripts, linters, and required checks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@commitlint/lint": "^21.2.3",
|
|
51
51
|
"@commitlint/load": "^21.2.3",
|
|
52
52
|
"@commitlint/types": "^21.2.3",
|
|
53
|
-
"@theholocron/
|
|
54
|
-
"@theholocron/
|
|
55
|
-
"@theholocron/
|
|
56
|
-
"@theholocron/
|
|
53
|
+
"@theholocron/datapad": "5.0.0-alpha.253",
|
|
54
|
+
"@theholocron/pkg-utils": "^1.16.1-alpha.1",
|
|
55
|
+
"@theholocron/json-utils": "^1.16.1-alpha.1",
|
|
56
|
+
"@theholocron/fs-utils": "^1.16.1-alpha.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@commitlint/config-conventional": "^21.2.3",
|
|
@@ -61,11 +61,7 @@
|
|
|
61
61
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
62
62
|
"@theholocron/commitlint-config": "^8.8.0",
|
|
63
63
|
"@theholocron/eslint-config": "^8.8.2",
|
|
64
|
-
"@theholocron/rollup-plugin-transform-template": "^8.8.2",
|
|
65
64
|
"@theholocron/semantic-release-config": "^8.8.2",
|
|
66
|
-
"@theholocron/tsconfig": "^8.8.2",
|
|
67
|
-
"@theholocron/tsdown-config": "^8.8.2",
|
|
68
|
-
"@theholocron/vitest-config": "^8.8.2",
|
|
69
65
|
"@types/node": "^26",
|
|
70
66
|
"@vitest/coverage-v8": "^5.0.5",
|
|
71
67
|
"@vitest/eslint-plugin": "^1.6.27",
|
|
@@ -74,7 +70,11 @@
|
|
|
74
70
|
"globals": "^17.11.0",
|
|
75
71
|
"tsdown": "^0.23.3",
|
|
76
72
|
"typescript": "^5.9.3",
|
|
77
|
-
"vitest": "^5.0.5"
|
|
73
|
+
"vitest": "^5.0.5",
|
|
74
|
+
"@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.3",
|
|
75
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.3",
|
|
76
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.3",
|
|
77
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.3"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@semantic-release/commit-analyzer": "^13",
|