@ornikar/repo-config 8.2.1 → 8.3.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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [8.3.0](https://github.com/ornikar/shared-configs/compare/@ornikar/repo-config@8.2.1...@ornikar/repo-config@8.3.0) (2022-04-22)
7
+
8
+
9
+ ### Features
10
+
11
+ * pre-push only run test changed since main branch [no issue] ([#698](https://github.com/ornikar/shared-configs/issues/698)) ([9e7aa2d](https://github.com/ornikar/shared-configs/commit/9e7aa2d4de6e3e8ff18567555cf405663e22942d))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [8.2.1](https://github.com/ornikar/shared-configs/compare/@ornikar/repo-config@8.2.0...@ornikar/repo-config@8.2.1) (2022-04-19)
7
18
 
8
19
  **Note:** Version bump only for package @ornikar/repo-config
@@ -137,10 +137,16 @@ fi
137
137
  writeHook('post-rewrite', postHookContent);
138
138
  }
139
139
 
140
+ const prePushHookPreCommands = [];
140
141
  const prePushHook = [];
141
142
 
142
143
  if (shouldRunTest()) {
143
- prePushHook.push(`CI=true ${pm.name} test`);
144
+ prePushHookPreCommands.push(
145
+ '# autodetect main branch (usually master or main)',
146
+ 'mainBranch = $(git remote show origin | grep "HEAD branch" | cut - d\' \' - f5)',
147
+ '',
148
+ );
149
+ prePushHook.push(`CI=true ${pm.name} test --changedSince=origin/$mainBranch`);
144
150
  }
145
151
 
146
152
  if (shouldRunChecks()) {
@@ -148,7 +154,10 @@ fi
148
154
  }
149
155
 
150
156
  if (prePushHook.length > 0) {
151
- writeHook('pre-push', prePushHook.join(' && '));
157
+ writeHook(
158
+ 'pre-push',
159
+ (prePushHookPreCommands ? [...prePushHookPreCommands, ''].join('\n') : '') + prePushHook.join(' && '),
160
+ );
152
161
  } else {
153
162
  ensureHookDeleted('pre-push');
154
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornikar/repo-config",
3
- "version": "8.2.1",
3
+ "version": "8.3.0",
4
4
  "description": "🔧 repo config",
5
5
  "repository": "ornikar/shared-configs",
6
6
  "license": "ISC",
@@ -27,5 +27,5 @@
27
27
  "which-pm-runs": "^1.1.0",
28
28
  "yarn-deduplicate": "3.1.0"
29
29
  },
30
- "gitHead": "48ba934054bbce6f4cb92b25538d5ebe3673469a"
30
+ "gitHead": "84a5569678aba249caa5cc23f6bd3e8e826ff3f3"
31
31
  }