@scaleway/changesets-renovate 1.1.4 → 1.2.1
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/CHANGELOG.md +12 -0
- package/dist/index.js +14 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1236](https://github.com/scaleway/scaleway-lib/pull/1236) [`3d05f84`](https://github.com/scaleway/scaleway-lib/commit/3d05f84b283859ef7ff336fc02e59a9ea1959d04) Thanks [@QuiiBz](https://github.com/QuiiBz)! - Create a new commit instead of amend + force push
|
|
8
|
+
|
|
9
|
+
## 1.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#1232](https://github.com/scaleway/scaleway-lib/pull/1232) [`00df173`](https://github.com/scaleway/scaleway-lib/commit/00df173821b759c5fd34b582142bafa8b86d276d) Thanks [@QuiiBz](https://github.com/QuiiBz)! - Ignore changes in workspace's root package.json
|
|
14
|
+
|
|
3
15
|
## 1.1.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,15 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import { simpleGit } from 'simple-git';
|
|
4
4
|
|
|
5
5
|
async function getPackagesNames(files) {
|
|
6
|
+
const packages = [];
|
|
6
7
|
const promises = files.map(async file => {
|
|
7
8
|
const data = JSON.parse(await fs.readFile(file, 'utf8'));
|
|
8
|
-
|
|
9
|
+
if (!data.workspaces) {
|
|
10
|
+
packages.push(data.name);
|
|
11
|
+
}
|
|
9
12
|
});
|
|
10
|
-
|
|
13
|
+
await Promise.all(promises);
|
|
14
|
+
return packages;
|
|
11
15
|
}
|
|
12
16
|
async function createChangeset(fileName, packageBumps, packages) {
|
|
13
17
|
let message = '';
|
|
@@ -54,18 +58,17 @@ async function run() {
|
|
|
54
58
|
return;
|
|
55
59
|
}
|
|
56
60
|
const packageNames = await getPackagesNames(files);
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
if (packageNames.length === 0) {
|
|
62
|
+
console.log('No packages modified, skipping');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const shortHash = (await simpleGit().revparse(['--short', 'HEAD'])).trim();
|
|
66
|
+
const fileName = `.changeset/renovate-${shortHash}.md`;
|
|
59
67
|
const packageBumps = await getBumps(files);
|
|
60
68
|
await createChangeset(fileName, packageBumps, packageNames);
|
|
61
69
|
await simpleGit().add(fileName);
|
|
62
|
-
await simpleGit().commit(
|
|
63
|
-
|
|
64
|
-
HEAD: null,
|
|
65
|
-
'--amend': null,
|
|
66
|
-
'--no-edit': null
|
|
67
|
-
});
|
|
68
|
-
await simpleGit().push(['--force']);
|
|
70
|
+
await simpleGit().commit(`Add changeset renovate-${shortHash}`);
|
|
71
|
+
await simpleGit().push();
|
|
69
72
|
}
|
|
70
73
|
run().catch(console.error);
|
|
71
74
|
|