Skip to content

Commit

Permalink
build and pack
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyAv46 committed Dec 15, 2023
1 parent 07b5e6c commit 14ae080
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var Output;
(function (Output) {
Output["wasSuccessful"] = "was_successful";
Output["wasSuccessfulByTarget"] = "was_successful_by_target";
Output["successfulPRs"] = "successful_prs";
})(Output || (Output = {}));
class Backport {
constructor(github, config, git) {
Expand Down Expand Up @@ -162,6 +163,7 @@ class Backport {
}
console.log(`Will copy labels matching ${this.config.copy_labels_pattern}. Found matching labels: ${labelsToCopy}`);
const successByTarget = new Map();
const successPRs = new Array();
for (const target of target_branches) {
console.log(`Backporting to target branch '${target}...'`);
try {
Expand Down Expand Up @@ -295,6 +297,7 @@ class Backport {
}
const message = this.composeMessageForSuccess(new_pr.number, target);
successByTarget.set(target, true);
successPRs.push(new_pr.number);
yield this.github.createComment({
owner,
repo,
Expand All @@ -318,7 +321,7 @@ class Backport {
}
}
}
this.createOutput(successByTarget);
this.createOutput(successByTarget, successPRs);
}
catch (error) {
if (error instanceof Error) {
Expand Down Expand Up @@ -384,11 +387,13 @@ class Backport {
return (0, dedent_1.default) `Successfully created backport PR for \`${target}\`:
- #${pr_number}`;
}
createOutput(successByTarget) {
createOutput(successByTarget, successPRs) {
const anyTargetFailed = Array.from(successByTarget.values()).includes(false);
core.setOutput(Output.wasSuccessful, !anyTargetFailed);
const byTargetOutput = Array.from(successByTarget.entries()).reduce((i, [target, result]) => `${i}${target}=${result}\n`, "");
core.setOutput(Output.wasSuccessfulByTarget, byTargetOutput);
const successPRsOutput = successPRs.join(" ");
core.setOutput(Output.successfulPRs, successPRsOutput);
}
}
exports.Backport = Backport;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit 14ae080

Please sign in to comment.