@@ -18741,7 +18741,7 @@ var require_core = __commonJS({
1874118741 return inputs2.map((input) => input.trim());
1874218742 }
1874318743 exports2.getMultilineInput = getMultilineInput2;
18744- function getBooleanInput (name, options) {
18744+ function getBooleanInput2 (name, options) {
1874518745 const trueValue = ["true", "True", "TRUE"];
1874618746 const falseValue = ["false", "False", "FALSE"];
1874718747 const val = getInput2(name, options);
@@ -18752,7 +18752,7 @@ var require_core = __commonJS({
1875218752 throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}
1875318753Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
1875418754 }
18755- exports2.getBooleanInput = getBooleanInput ;
18755+ exports2.getBooleanInput = getBooleanInput2 ;
1875618756 function setOutput(name, value) {
1875718757 const filePath = process.env["GITHUB_OUTPUT"] || "";
1875818758 if (filePath) {
@@ -42837,7 +42837,8 @@ async function main({
4283742837 mainBranch,
4283842838 perennialBranches,
4283942839 currentPullRequest,
42840- pullRequests
42840+ pullRequests,
42841+ skipSingleStacks
4284142842}) {
4284242843 const repoGraph = new import_graphology.MultiDirectedGraph();
4284342844 repoGraph.addNode(mainBranch, {
@@ -42860,28 +42861,28 @@ async function main({
4286042861 repoGraph.addDirectedEdge(pullRequest.baseRefName, pullRequest.headRefName);
4286142862 });
4286242863 const getStackGraph = (pullRequest) => {
42863- const stackGraph = repoGraph.copy();
42864- stackGraph .setNodeAttribute(pullRequest.headRefName, "isCurrent", true);
42864+ const stackGraph2 = repoGraph.copy();
42865+ stackGraph2 .setNodeAttribute(pullRequest.headRefName, "isCurrent", true);
4286542866 (0, import_graphology_traversal.bfsFromNode)(
42866- stackGraph ,
42867+ stackGraph2 ,
4286742868 pullRequest.headRefName,
4286842869 (ref, attributes) => {
42869- stackGraph .setNodeAttribute(ref, "shouldPrint", true);
42870+ stackGraph2 .setNodeAttribute(ref, "shouldPrint", true);
4287042871 return attributes.type === "perennial";
4287142872 },
4287242873 {
4287342874 mode: "inbound"
4287442875 }
4287542876 );
4287642877 (0, import_graphology_traversal.dfsFromNode)(
42877- stackGraph ,
42878+ stackGraph2 ,
4287842879 pullRequest.headRefName,
4287942880 (ref) => {
42880- stackGraph .setNodeAttribute(ref, "shouldPrint", true);
42881+ stackGraph2 .setNodeAttribute(ref, "shouldPrint", true);
4288142882 },
4288242883 { mode: "outbound" }
4288342884 );
42884- return stackGraph ;
42885+ return stackGraph2 ;
4288542886 };
4288642887 const getOutput = (graph) => {
4288742888 const lines = [];
@@ -42910,14 +42911,25 @@ async function main({
4291042911 return lines.join("\n");
4291142912 };
4291242913 const jobs = [];
42913- getStackGraph(currentPullRequest).forEachNode((_, stackNode) => {
42914+ const stackGraph = getStackGraph(currentPullRequest);
42915+ const shouldSkip = () => {
42916+ const neighbors = stackGraph.neighbors(currentPullRequest.headRefName);
42917+ const allPerennialBranches = stackGraph.filterNodes(
42918+ (_, nodeAttributes) => nodeAttributes.type === "perennial"
42919+ );
42920+ return skipSingleStacks && neighbors.length === 1 && allPerennialBranches.includes(neighbors.at(0) || "");
42921+ };
42922+ if (shouldSkip()) {
42923+ return;
42924+ }
42925+ stackGraph.forEachNode((_, stackNode) => {
4291442926 if (stackNode.type !== "pull-request" || !stackNode.shouldPrint) {
4291542927 return;
4291642928 }
4291742929 jobs.push(async () => {
4291842930 core.info(`Updating stack details for PR #${stackNode.number}`);
42919- const stackGraph = getStackGraph(stackNode);
42920- const output = getOutput(stackGraph );
42931+ const stackGraph2 = getStackGraph(stackNode);
42932+ const output = getOutput(stackGraph2 );
4292142933 let description = stackNode.body ?? "";
4292242934 description = updateDescription({
4292342935 description,
@@ -46824,6 +46836,13 @@ var inputs = {
4682446836 getToken() {
4682546837 return core2.getInput("github-token", { required: true, trimWhitespace: true });
4682646838 },
46839+ getSkipSingleStacks() {
46840+ core2.startGroup("Inputs: Skip single stacks");
46841+ const input = core2.getBooleanInput("skip-single-stacks", { required: false });
46842+ core2.info(input.toString());
46843+ core2.endGroup();
46844+ return input;
46845+ },
4682746846 async getMainBranch(octokit, config2, context3) {
4682846847 const {
4682946848 data: { default_branch: defaultBranch }
@@ -46975,7 +46994,8 @@ async function run() {
4697546994 currentPullRequest: inputs.getCurrentPullRequest(github2.context),
4697646995 pullRequests,
4697746996 mainBranch,
46978- perennialBranches
46997+ perennialBranches,
46998+ skipSingleStacks: inputs.getSkipSingleStacks()
4697946999 };
4698047000 void main(context3);
4698147001 } catch (error) {
0 commit comments