ci: weekly dprint plugin auto-update workflow (#236)#238
Merged
Conversation
Adds .github/workflows/dprint-update.yml per #236. Schedule: Mondays 09:00 UTC. Each Monday the workflow: 1. Installs the locally-pinned dprint (^0.54.0 via npm). 2. Runs 'npx dprint config update -y' to bump every plugin in dprint.json to latest. 3. Runs 'npx dprint fmt' to apply formatting changes from new plugin rules (separates 'rule tightening' from version bumps in the diff). 4. Detects drift via git status --porcelain. If empty, exits clean with no PR. 5. If drift, opens a PR via peter-evans/create-pull-request@v6 with branch name 'chore/dprint-plugin-update' (auto-deleted on merge) and body referencing #236. Safety: - concurrency block cancels in-flight runs on overlap (manual trigger + cron can theoretically collide) - workflow-level permissions: {} default; job-level overrides to 'contents: write, pull-requests: write' (least privilege) - actions pinned to commit SHAs with version comments, matching the project's existing convention (ci.yml) - uses GITHUB_TOKEN explicitly on the create-pull-request step If a plugin upgrade causes widespread reformat noise, that PR is the place to review + scope down.
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.
What
Adds
.github/workflows/dprint-update.yml. Mondays 09:00 UTC it installs the locally-pinned dprint, runsnpx dprint config update -yto bump every plugin indprint.jsonto latest, runsnpx dprint fmtto apply any formatting drift from new plugin rules, and opens a PR ifdprint.json(or any formatted file) actually changed.If nothing changed, exits clean — no PR spam.
Schedule
gh workflow run dprint-update.ymlfor ad-hoc bumpsPattern
Three of the existing CI workflows already follow the
actions/checkout@${sha} # v{N}andactions/setup-node@${sha} # v{N}pinning pattern from #227 — this workflow matches that convention.Least-privilege
permissions:: workflow-level{}(read-only default), withcontents: write+pull-requests: writeoverridden at the job level. Borrowed from the same shape as ci.yml.concurrencyblock cancels in-flight runs on overlap (concurrent manual + cron trigger) — same pattern as #237.Files
Notes
dprint@^0.54.0(matching the npm devDependency) is used rather than curl-installing latest. Reproducible behavior matching what devs see in lefthook's pre-commit dprint hook.gh workflow disable dprint-update.yml.Resolves #236.