Skip to content

Commit

Permalink
feat: support template in labels (#8138)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
  • Loading branch information
suzuki-shunsuke and viceice committed Dec 30, 2020
1 parent 195a473 commit de852ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/util/template/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const exposedConfigOptions = [
'groupSlug',
'groupName',
'additionalBranchPrefix',
'addLabels',
'labels',
'prBodyColumns',
'prBodyDefinitions',
'prBodyNotes',
Expand Down
5 changes: 4 additions & 1 deletion lib/workers/pr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
getBranchLastCommitTime,
isBranchModified,
} from '../../util/git';
import * as template from '../../util/template';
import { BranchConfig, PrResult } from '../common';
import { Limit, isLimitReached } from '../global/limits';
import { getPrBody } from './body';
Expand Down Expand Up @@ -389,7 +390,9 @@ export async function ensurePr(
targetBranch: config.baseBranch,
prTitle,
prBody,
labels: [...new Set([...config.labels, ...config.addLabels])],
labels: [
...new Set([...config.labels, ...config.addLabels]),
].map((label) => template.compile(label, config)),
platformOptions: getPlatformPrOptions(config),
draftPR: config.draftPR,
});
Expand Down

0 comments on commit de852ac

Please sign in to comment.