Skip to content

ci: weekly dprint plugin auto-update workflow (#236)#238

Merged
EVWorth merged 1 commit into
mainfrom
feat/236-dprint-update-workflow
Jul 20, 2026
Merged

ci: weekly dprint plugin auto-update workflow (#236)#238
EVWorth merged 1 commit into
mainfrom
feat/236-dprint-update-workflow

Conversation

@EVWorth

@EVWorth EVWorth commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What

Adds .github/workflows/dprint-update.yml. Mondays 09:00 UTC it installs the locally-pinned dprint, runs npx dprint config update -y to bump every plugin in dprint.json to latest, runs npx dprint fmt to apply any formatting drift from new plugin rules, and opens a PR if dprint.json (or any formatted file) actually changed.

If nothing changed, exits clean — no PR spam.

Schedule

  • Cron: Mondays 09:00 UTC (weekday morning so reviewers see it in their queue rather than over a weekend)
  • Manual dispatch: gh workflow run dprint-update.yml for ad-hoc bumps

Pattern

Three of the existing CI workflows already follow the actions/checkout@${sha} # v{N} and actions/setup-node@${sha} # v{N} pinning pattern from #227 — this workflow matches that convention.

Least-privilege permissions:: workflow-level {} (read-only default), with contents: write + pull-requests: write overridden at the job level. Borrowed from the same shape as ci.yml.

concurrency block cancels in-flight runs on overlap (concurrent manual + cron trigger) — same pattern as #237.

Files

.github/workflows/dprint-update.yml   (new, 94 lines)

Notes

  • Plugin bumps land separately from human PRs. If a major dprint plugin release has wide reformat implications, the auto-PR is the place to review + scope down.
  • Locally-installed 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.
  • If you ever want to disable the schedule, gh workflow disable dprint-update.yml.

Resolves #236.

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.
@EVWorth
EVWorth merged commit bce8316 into main Jul 20, 2026
10 checks passed
@EVWorth
EVWorth deleted the feat/236-dprint-update-workflow branch July 20, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: automate dprint plugin updates via weekly scheduled workflow

1 participant