@psm14/semantic-release-path-filter 1.1.0 → 1.1.2

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/index.js +5 -1
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,9 +1,13 @@
1
1
  import { execSync } from "child_process";
2
+ import { relative } from "path";
2
3
 
3
4
  function filterCommits({ commits, logger }, path) {
4
5
  return commits.filter((commit) => {
5
6
  const changedFiles = getChangedFiles(commit.hash);
6
- const isRelevant = changedFiles.some((file) => file.startsWith(path));
7
+ const isRelevant = changedFiles.some((file) => {
8
+ const relativePath = relative(path, file);
9
+ return !relativePath.startsWith('..');
10
+ });
7
11
  if (!isRelevant) {
8
12
  logger.info(
9
13
  `Filtered out commit ${commit.hash.slice(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psm14/semantic-release-path-filter",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "README.md"
12
12
  ],
13
13
  "author": "Patrick McLaughlin <me@patmclaughl.in>",
14
- "license": "ISC",
14
+ "license": "MIT",
15
15
  "description": "Wraps a semantic-release plugin to only run on commits in a specific path",
16
16
  "repository": {
17
17
  "type": "git",