Repository navigation
ci: add manually invoked version-bump workflow - #160
Conversation
|
I have some thoughts, I will provide them tomorrow, 2026-09-28. |
sshine
left a comment
There was a problem hiding this comment.
- Using
sedis a little brittle. Technically, the Cargo.toml format allows for multiple^version.at least terminates at the first one.sed -i -E '0,/^version = "[^"]*"/s//version = "'"$VERSION"'"/' Cargo.toml. cargo checkseems like not enough: How aboutmake ci?- If
versionis the current one andupdate_cratesis false,git diff --quietcould short-circuit the CI and save quite a few minutes. - There is no "greater than the previous version" bounds check.
- While release.yml has an unprivileged
verifyjob, bump-version.yml does not. # Nothing at the top levelsits abovepermissions: contents: read, which is not nothing.
Split bump-version into an unprivileged verify job and a privileged open-pr job that applies verify's patch. Verify now runs make ci, rejects versions lower than the current one, rewrites only the first version line of Cargo.toml, and skips the PR when nothing changed.
Looks like it fixed everything (see quote below). It decided to go with allowing a same version (i.e. no bump) which would then be able to update all deps without bumping the crate version. Seems fine to me. Good call on the permission splitting; fixed. Thank you.
|
Human Summary
Adds an actions program that can take the version number as an input, bump the version and open a PR. Optionally, it can run
cargo updateas well.AI Summary
Adds
.github/workflows/bump-version.yml, aworkflow_dispatchworkflow that:versioninput (no leadingv, e.g.3.4.1, format-validated) and anupdate_cratesbooleanCargo.toml(andCargo.lockviacargo check)cargo updatewhenupdate_cratesis truecargo checkand only opens the PRchore: bump version to v<version>if it passesSecurity posture follows
release.yml: top-levelcontents: read, with the job scoped tocontents: write+pull-requests: write, actions pinned by SHA, inputs validated before checkout, serialized viaconcurrency, and only runnable from main by users with write access (workflow_dispatch). Note that PRs created withGITHUB_TOKENdo not trigger other workflows, so the in-workspacecargo checkis the verification gate.