Skip to content

Commit

Permalink
dist: build new artifacts
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Korthout <korthout@users.noreply.github.com>
  • Loading branch information
korthout committed Jun 8, 2023
1 parent 82e468a commit d070af3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class Backport {
}
findTargetBranches(mainpr, config) {
const labels = mainpr.labels.map((label) => label.name);
return findTargetBranches(config, labels);
return findTargetBranches(config, labels, mainpr.head.ref);
}
composePRContent(target, main) {
const title = utils.replacePlaceholders(this.config.pull.title, main, target);
Expand Down Expand Up @@ -301,17 +301,20 @@ class Backport {
}
}
exports.Backport = Backport;
function findTargetBranches(config, labels) {
function findTargetBranches(config, labels, headref) {
var _a, _b;
console.log("Determining target branches...");
console.log(`Detected labels on PR: ${labels}`);
const targetBranchesFromLabels = findTargetBranchesFromLabels(labels, config);
const configuredTargetBranches = (_b = (_a = config.target_branches) === null || _a === void 0 ? void 0 : _a.split(" ").map((t) => t.trim()).filter((t) => t !== "")) !== null && _b !== void 0 ? _b : [];
console.log(`Found target branches in labels: ${targetBranchesFromLabels}`);
console.log(`Found target branches in \`target_branches\` input: ${configuredTargetBranches}`);
return [
console.log(`Exclude pull request's headref from target branches: ${headref}`);
const targetBranches = [
...new Set([...targetBranchesFromLabels, ...configuredTargetBranches]),
];
].filter((t) => t !== headref);
console.log(`Determined target branches: ${targetBranches}`);
return targetBranches;
}
exports.findTargetBranches = findTargetBranches;
function findTargetBranchesFromLabels(labels, config) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit d070af3

Please sign in to comment.