Skip to content

Commit

Permalink
feat: changelog with source directories
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <adam.setch@outlook.com>
  • Loading branch information
setchy committed Nov 23, 2024
1 parent 6077ba0 commit 96193d0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/workers/repository/update/pr/changelog/bitbucket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ export async function getReleaseNotesMd(
const allFiles = rootFiles.filter((f) => f.type === 'commit_file');

const files = allFiles.filter((f) =>
changelogFilenameRegex.test(f.path.split('/').pop() ?? ''),
changelogFilenameRegex.test(getFilenameFromPath(f.path)),
);

const changelogFile = files
.sort((a, b) => compareChangelogFilePath(a.path, b.path))
.sort((a, b) =>
compareChangelogFilePath(
getFilenameFromPath(a.path),
getFilenameFromPath(b.path),
),
)
.shift();
if (is.nullOrUndefined(changelogFile)) {
logger.trace('no changelog file found');
Expand Down Expand Up @@ -76,6 +81,10 @@ export async function getReleaseNotesMd(
return { changelogFile: changelogFile.path, changelogMd };
}

function getFilenameFromPath(filePath: string): string {
return filePath.split('/').pop()!;
}

export function getReleaseList(
_project: ChangeLogProject,
_release: ChangeLogRelease,
Expand Down

0 comments on commit 96193d0

Please sign in to comment.