Repository navigation
Conversation
The Knip and Jest workflows were copy-pasted into every repository that inherits from this template, and they drifted: checkout v4 vs v5, setup-bun v1 vs v2, and two different ways of producing knip-results.json. Both are now workflow_call workflows with explicit inputs for the package manager, Node version, working directory, script names and lockfile policy. This repository consumes them through its own callers, so knip-reporter keeps receiving its artifact under the same workflow name. Also fixes the PR number written by the Knip job: github.event.number is empty on workflow_dispatch, so the value is now resolved once and exposed as an output, with an explicit input for callers that know the number. Refs: ubiquity-os#13
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Closes #13.
Why
The Knip and Jest workflows are copy-pasted into every repository that inherits from this template, and they have already drifted:
v5v4, andmasterin jestv2v1andv2knip --reporter jsonknip-ciEvery copy is a place a fix has to be applied again. Fixing the workflow in the template does not reach the repositories that already inherited from it.
What
Two new reusable workflows,
workflow_callonly:.github/workflows/knip-reusable.yml.github/workflows/jest-reusable.ymlInputs cover exactly the drift listed above:
package-manager(bun/yarn),node-version,working-directory,knip-command,knip-json-command,test-command,dashboard-file,frozen-lockfile,checkout-ref,fetch-depth, artifact names, pluspr-numberfor dispatch runs.This repository now consumes them through its own callers, which shrink to the job declaration and its inputs. The caller workflow names are unchanged (
Knip,Run Jest testing suite) soknip-reporter.yml, which listens onworkflow_run: workflows: ["Knip"], keeps receiving theknip-resultsartifact from the same run.Bug fixed on the way
The Knip job wrote
github.event.numberintopr-number.txt. That value is empty onworkflow_dispatch, so the reporter received an empty PR number. The number is now resolved once, exposed as a job output, and can be passed explicitly through thepr-numberinput.Behaviour that is deliberately preserved
--frozen-lockfile.NODE_ENV=testandfetch-depth: 0.contents: read+actions: write, replacingwrite-all.Verification (local, on this branch)
bun x prettier@3.6.2 --checkon all four files: clean (the six other workflow files already fail this ondevelopmentand are untouched here).js-yaml.bun installthenbun run test: 5/5 tests pass, coverage 78.78% statements, dashboard generated.bun run knip: exit 0.Migration for consumers
Any repository can replace its copy with:
ubiquity/ts-templateis the immediate next consumer; I can open that PR separately once this lands, to keep each change reviewable on its own.No runtime code is touched; only
.github/workflows/.