Commit 2d07d6e
fix: report new version when commit is false and no version files update
`outputs.version` is sourced from `cz version --project` after the
bump. When `commit: false` is combined with a `version_provider` that
does not write to any tracked file (notably `version_provider = "scm"`),
the bump does not update any version file and does not create a git
tag, so `cz version --project` keeps reporting the previous version.
The action then exposes the old version on `outputs.version`,
`outputs.next_version` and the major/minor variants, even though the
bump command itself printed `bump: version X -> Y` correctly.
Capture the next version with `cz bump --get-next` before running
the actual bump (it is a calculation, no state change), and use it as
a fallback when `cz version --project` still equals the previous
version after the bump. Major/minor are derived from the same value so
they match. Failures of `--get-next` (e.g. no bumpable commits) are
tolerated and leave the existing behaviour untouched.
Closes #94
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 338bbd8 commit 2d07d6e
1 file changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| |||
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
112 | 134 | | |
113 | 135 | | |
114 | 136 | | |
115 | 137 | | |
116 | 138 | | |
117 | 139 | | |
118 | 140 | | |
119 | | - | |
120 | 141 | | |
121 | 142 | | |
122 | | - | |
123 | 143 | | |
124 | 144 | | |
125 | 145 | | |
| |||
0 commit comments