ci: auto-update the macros submodule via Dependabot#117
Conversation
Add a Dependabot config so the macros submodule is bumped automatically: Dependabot opens a PR whenever its tracked branch (main) advances, removing the manual 'git submodule update --remote' step. See the ADR in d-morrison/macros (docs/adr/0001-macros-submodule-versioning.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DrceBhXtcKRFaPPEMwxAZN
|
Claude finished @d-morrison's task in 1m 27s —— View job Code Review — PR #117
Verdict: Clean ✓The config is correct and well-motivated. YAML is valid, One optional non-blocking suggestion posted inline: since the repo's workflows already reference several third-party Actions at pinned major versions, this is a natural moment to also add a |
There was a problem hiding this comment.
Pull request overview
This PR adds a Dependabot configuration to automatically open PRs when the macros git submodule advances, reducing manual submodule bump/commit work in this template and downstream repos generated from it.
Changes:
- Add
.github/dependabot.ymlconfiguring Dependabot’sgitsubmoduleupdater to run weekly for the repository root. - Customize Dependabot PR commit message prefix to
chore(submodule).
| schedule: | ||
| interval: "weekly" | ||
| commit-message: | ||
| prefix: "chore(submodule)" |
There was a problem hiding this comment.
The repo's workflows use a number of third-party Actions at pinned major versions (actions/checkout@v4, r-lib/actions/setup-r@v2, quarto-dev/quarto-actions/setup@v2, etc.). Now that dependabot.yml exists, adding a github-actions ecosystem entry here is zero extra effort and keeps action pins current automatically:
| prefix: "chore(submodule)" | |
| commit-message: | |
| prefix: "chore(submodule)" | |
| - package-ecosystem: "github-actions" | |
| directory: "/" | |
| schedule: | |
| interval: "weekly" | |
| commit-message: | |
| prefix: "chore(actions)" |
Not a blocker — just a natural complement to the submodule entry.
There was a problem hiding this comment.
Good idea, but I'm keeping this PR scoped to the submodule automation that was requested. A github-actions ecosystem entry is a separate (also reasonable) kind of update that would start opening action-bump PRs across this template and every repo generated from it, so it's worth deciding on deliberately rather than bundling it in here. Easy to add as a follow-up if you'd like it — the snippet above is exactly right.
Generated by Claude Code
The .gitmodules entry sets no explicit branch, so Dependabot follows the macros submodule's default branch (currently main). Reword the comment to say so rather than implying main is configured (per review feedback). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DrceBhXtcKRFaPPEMwxAZN
|
Claude finished @d-morrison's task in 1m 30s —— View job Code Review — PR #117
Verdict: Clean ✓The config is correct and well-formed. The comment wording — "submodule's default branch (currently One optional inline suggestion posted: add a |
| schedule: | ||
| interval: "weekly" | ||
| commit-message: | ||
| prefix: "chore(submodule)" |
There was a problem hiding this comment.
The gitsubmodule entry is correct. Since dependabot.yml now exists, adding a github-actions entry would also keep the workflow action pins current with zero extra maintenance cost:
| prefix: "chore(submodule)" | |
| commit-message: | |
| prefix: "chore(submodule)" | |
| - package-ecosystem: "github-actions" | |
| directory: "/" | |
| schedule: | |
| interval: "weekly" | |
| commit-message: | |
| prefix: "chore(actions)" |
Note: the two @HEAD pins in existing workflows (quarto-dev/quarto-actions/setup@HEAD, r-lib/actions/setup-r-dependencies@HEAD) are unversioned and Dependabot won't touch them — but it would bump all the @v2/@v4 pins, including resolving the mixed actions/checkout@v4 vs @v5 across workflows. Non-blocking.
|
Summary
Adds a Dependabot config so the
macrossubmodule is bumped automatically instead of by hand.This template embeds
macrosas a submodule (trackingmain). Dependabot'sgitsubmoduleupdater opens a PR whenever that branch advances, removing the manualgit submodule update --remote+ commit step.Why this (and not a sliding tag)
Follow-through on the ADR in
d-morrison/macros: a sliding tag/branch wouldn't remove the manual bump, because a submodule gitlink only advances when a consumer updates and commits it. Dependabot is the automation that actually closes that loop — and it tracks a branch (main), the only ref that--remote-style tracking can follow.Template note
Because this is a template, the config propagates to books generated from it via "Use this template" — so downstream books also get hands-off
macrosupdates. It adds no package/extension dependency, only a.github/dependabot.yml.Config
🤖 Generated with Claude Code
https://claude.ai/code/session_01DrceBhXtcKRFaPPEMwxAZN
Generated by Claude Code