@d-zero/release-automation 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/io/repo.js +9 -3
- package/package.json +1 -1
package/dist/io/repo.js
CHANGED
|
@@ -142,20 +142,26 @@ export function publishModeAt(git, rev) {
|
|
|
142
142
|
* automation acts on. The checks of a pull request read `HEAD` instead, so
|
|
143
143
|
* that the pull request that brings in or changes the definition is checked
|
|
144
144
|
* against what it proposes.
|
|
145
|
+
*
|
|
146
|
+
* The version of `dev` is always read from `origin/dev`, whatever the
|
|
147
|
+
* revision: the current major is the one `dev` carries. On a previous line
|
|
148
|
+
* the checked-out `lerna.json` states the previous major, and reading it
|
|
149
|
+
* there would make `dev` look like it carries that line.
|
|
145
150
|
* @param git - Git access
|
|
146
151
|
* @param now - The current time
|
|
147
|
-
* @param rev - The revision the files are read from
|
|
152
|
+
* @param rev - The revision the definition files are read from
|
|
148
153
|
* @returns The facts
|
|
149
154
|
* @example
|
|
150
155
|
* classify(readFacts(git, new Date()));
|
|
151
156
|
* classify(readFacts(git, new Date(), 'HEAD'));
|
|
152
157
|
*/
|
|
153
158
|
export function readFacts(git, now, rev = `origin/${CURRENT_BRANCH}`) {
|
|
154
|
-
const
|
|
159
|
+
const devRev = `origin/${CURRENT_BRANCH}`;
|
|
160
|
+
const lerna = git.show(devRev, 'lerna.json');
|
|
155
161
|
const root = JSON.parse(git.show(rev, 'package.json') ?? '{}');
|
|
156
162
|
const codeowners = git.show(rev, '.github/CODEOWNERS');
|
|
157
163
|
return {
|
|
158
|
-
devVersion: versionAt(git,
|
|
164
|
+
devVersion: versionAt(git, devRev),
|
|
159
165
|
lernaVersion: lerna === null
|
|
160
166
|
? null
|
|
161
167
|
: (JSON.parse(lerna).version ?? null),
|