@psm14/semantic-release-path-filter 1.1.2 → 1.1.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.
- package/index.js +9 -2
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
import { execSync } from "child_process";
|
2
|
-
import { relative } from "path";
|
2
|
+
import { relative, resolve } from "path";
|
3
3
|
|
4
4
|
function filterCommits({ commits, logger }, path) {
|
5
|
+
const absoluteFilterPath = resolve(path);
|
6
|
+
logger.debug(`Filter path resolved to: ${absoluteFilterPath}`);
|
7
|
+
|
5
8
|
return commits.filter((commit) => {
|
6
9
|
const changedFiles = getChangedFiles(commit.hash);
|
7
10
|
const isRelevant = changedFiles.some((file) => {
|
8
|
-
const
|
11
|
+
const absoluteFilePath = resolve(file);
|
12
|
+
const relativePath = relative(absoluteFilterPath, absoluteFilePath);
|
13
|
+
|
14
|
+
logger.debug(`Checking file: ${file} -> ${absoluteFilePath} -> relativePath: ${relativePath}`);
|
15
|
+
|
9
16
|
return !relativePath.startsWith('..');
|
10
17
|
});
|
11
18
|
if (!isRelevant) {
|