Skip to content

Commit

Permalink
fix(workers/branchName): template groupName before slugging (#25490)
Browse files Browse the repository at this point in the history
  • Loading branch information
secustor committed Oct 29, 2023
1 parent 09c2a6a commit 50e3f82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/workers/repository/updates/branch-name.spec.ts
Expand Up @@ -15,6 +15,19 @@ describe('workers/repository/updates/branch-name', () => {
expect(upgrade.branchName).toBe('some-group-name-grouptopic');
});

it('compile groupName before slugging', () => {
const upgrade: RenovateConfig = {
groupName: '{{parentDir}}',
parentDir: 'myService',
group: {
branchName: '{{groupSlug}}-{{branchTopic}}',
branchTopic: 'grouptopic',
},
};
generateBranchName(upgrade);
expect(upgrade.branchName).toBe('myservice-grouptopic');
});

it('uses groupSlug if defined', () => {
const upgrade: RenovateConfig = {
groupName: 'some group name',
Expand Down
1 change: 1 addition & 0 deletions lib/workers/repository/updates/branch-name.ts
Expand Up @@ -48,6 +48,7 @@ function cleanBranchName(
export function generateBranchName(update: RenovateConfig): void {
// Check whether to use a group name
if (update.groupName) {
update.groupName = template.compile(update.groupName, update);
logger.trace('Using group branchName template');
// TODO: types (#22198)
logger.trace(
Expand Down

0 comments on commit 50e3f82

Please sign in to comment.