@scaleway/changesets-renovate 1.1.3 → 1.2.0

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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
8
+
9
+ ## 1.1.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1230](https://github.com/scaleway/scaleway-lib/pull/1230) [`32ffb7c`](https://github.com/scaleway/scaleway-lib/commit/32ffb7c1dad41251a881f5eb58ca29d180c8a5d5) Thanks [@QuiiBz](https://github.com/QuiiBz)! - Fix commit command
14
+
3
15
  ## 1.1.3
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
- return data.name;
9
+ if (!data.workspaces) {
10
+ packages.push(data.name);
11
+ }
9
12
  });
10
- return Promise.all(promises);
13
+ await Promise.all(promises);
14
+ return packages;
11
15
  }
12
16
  async function createChangeset(fileName, packageBumps, packages) {
13
17
  let message = '';
@@ -54,13 +58,18 @@ async function run() {
54
58
  return;
55
59
  }
56
60
  const packageNames = await getPackagesNames(files);
61
+ if (packageNames.length === 0) {
62
+ console.log('No packages modified, skipping');
63
+ return;
64
+ }
57
65
  const shortHash = await simpleGit().revparse(['--short', 'HEAD']);
58
66
  const fileName = `.changeset/renovate-${shortHash.trim()}.md`;
59
67
  const packageBumps = await getBumps(files);
60
68
  await createChangeset(fileName, packageBumps, packageNames);
61
69
  await simpleGit().add(fileName);
62
70
  await simpleGit().commit([], undefined, {
63
- '-C': 'HEAD',
71
+ '-C': null,
72
+ HEAD: null,
64
73
  '--amend': null,
65
74
  '--no-edit': null
66
75
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/changesets-renovate",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "Automatically create changesets for Renovate",
5
5
  "keywords": [
6
6
  "changesets",