Repository navigation
Closed
Labels
Description
Goal
Pin the existing dprint plugin manifest to a weekly cron job that runs dprint config update, diffs the change, and auto-opens a PR if anything in dprint.json moved.
Why
dprint plugins currently require manual bumping whenever a plugin publishes a release. Today's plugin set:
typescript: 0.93.3 -> 0.96.1 (last bumped manually in #235)
json: 0.20.0 -> 0.23.0 (last bumped manually in #235)
markdown: 0.18.0 -> 0.22.1 (last bumped manually in #235)
yaml: added in #235 (g-plane/pretty_yaml-v0.6.0)
toml: 0.6.2 -> 0.7.0 (last bumped manually in #235)
Each plugin has its own release cadence (https://plugins.dprint.dev/ exposes latestVersions JSON), and dprint itself prints plugin version warnings on every run. Manual-bump is easy to forget; PR #235 only happened because someone (me) was poking around for a different reason.
Tool landscape
dprint config update -y— dprint's built-in command that walks the plugin manifest and rewrites it to current versions. Non-interactive with-y. Output is a deterministic diff ofdprint.jsonif anything moved; no-op otherwise.dprint add <name>/dprint add <gh-org>/<gh-repo>— for adding NEW plugins (out of scope for this issue; we don't auto-add, just auto-bump what we already have).- No Dependabot equivalent for dprint: GitHub Dependabot doesn't manage
dprint.jsonplugin URLs. - Renovate has a
dprintmanager but the team isn't using Renovate today; adding it just for this would be heavier than writing the workflow.
Proposed implementation (~30 lines of yaml in a new workflow)
# .github/workflows/dprint-update.yml
name: dprint Plugin Updates
on:
schedule:
# Mondays 09:00 UTC
- cron: "0 9 * * 1"
workflow_dispatch: # manual run for testing
jobs:
bump:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install dprint
run: curl -fsSL https://dprint.dev/install.sh | sh
- name: Run dprint config update
run: dprint config update -y
- name: Check for changes
id: diff
run: |
if git diff --quiet dprint.json; then
echo "changed=false" >> \$GITHUB_OUTPUT
else
echo "changed=true" >> \$GITHUB_OUTPUT
fi
- name: Open PR if plugins drifted
if: steps.diff.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
title: 'chore(deps): bump dprint plugins'
commit-message: 'chore(deps): bump dprint plugins via dprint config update'
branch: chore/dprint-plugin-update
delete-branch: trueAcceptance criteria
-
.github/workflows/dprint-update.ymlexists; weekly cron + manual dispatch both work. - When
dprint config updatemakes no change todprint.json, the workflow run ends with status "success, no PR" (no PR opened, no spam). - When the plugin manifest moves, a PR is opened titled
chore(deps): bump dprint pluginswith the diff committed and the body listing from→to versions. - Workflow runs in <2 minutes (the install + config update steps are the bulk).
- Permissions scoped to
contents: write+pull-requests: writeonly on the workflow itself, not on the broader CI token.
Operational notes
- The cron runs after Dependabot (
cooldown: { default-days: 7 }) makes its own bumps, so the two bots don't fight. dprint updates arrive ~1 day after the npm group updates. - The branch name
chore/dprint-plugin-updatecollides if two runs land on the same day. Either increment suffix in PR title or usecreate-pull-request-actionwith a unique-per-run branch likechore/dprint-update-\${{ github.run_id }}. - If dprint later adds
config lock(a feature under discussion per dprint issue tracker), this workflow becomes a no-op once. Revisit then.
Related
- PR feat: enable dprint YAML plugin + bump plugins to latest (#215) #235 added the YAML plugin + bumped existing plugins to latest. Did this manually; would love to never do it again.
- dprint
config updatedocs: https://dprint.dev/cli/ - Plugin index: https://plugins.dprint.dev/
Activity
ci: cancel superseded runs + skip redundant post-close re-runs (#237)
ci: weekly dprint plugin auto-update workflow (#236) (#238)