@ffflorian/auto-merge 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/dist/cli.js +11 -5
  2. package/package.json +3 -2
package/dist/cli.js CHANGED
@@ -46,12 +46,18 @@ async function runAction(autoMerge, repositories, pullRequestSlug) {
46
46
  approveResults = await autoMerge.approveByMatch(regex, repositories);
47
47
  }
48
48
  const mergeResults = await autoMerge.mergeByMatch(regex, repositories);
49
- const actedRepositories = [...approveResults, ...mergeResults].reduce((count, repository) => {
50
- return count + repository.actionResults.length;
51
- }, 0);
52
- const prPluralized = pluralize('PR', actedRepositories);
49
+ const successCount = [...approveResults, ...mergeResults].filter(repository => {
50
+ return repository.actionResults.some(result => result.error === undefined);
51
+ }).length;
52
+ const prPluralized = pluralize('PR', successCount);
53
53
  const doAction = configFileData.autoApprove ? 'Approved and merged' : 'Merged';
54
- logger.info(`${doAction} ${actedRepositories} ${prPluralized} matching "${regex}".`);
54
+ const infoMessage = `${doAction} ${successCount} ${prPluralized} matching "${regex}".`;
55
+ if (successCount === 0) {
56
+ logger.warn(infoMessage);
57
+ }
58
+ else {
59
+ logger.info(infoMessage);
60
+ }
55
61
  }
56
62
  function askQuestion(question) {
57
63
  return new Promise(resolve => {
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "http-status-codes": "2.3.0",
13
13
  "nock": "14.0.10",
14
14
  "rimraf": "6.0.1",
15
- "typescript": "5.9.2",
15
+ "typescript": "5.9.3",
16
16
  "vitest": "3.2.4"
17
17
  },
18
18
  "engines": {
@@ -38,5 +38,6 @@
38
38
  "test": "vitest run"
39
39
  },
40
40
  "type": "module",
41
- "version": "1.0.2"
41
+ "version": "1.0.3",
42
+ "gitHead": "94d97abc477f53014bb009cd52828133a55052b3"
42
43
  }