Skip to content

Commit 253bf93

Browse files
committed
feat: add suggestions-skipped output
1 parent 0246bfe commit 253bf93

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Diff for: run/action.yml

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ outputs:
6767
description: "The title to use if opening fixes as a new PR"
6868
restyled-body:
6969
description: "The body to use if opening fixes as a new PR"
70+
suggestions-skipped:
71+
description: "True if there were suggestions we had to skip"
7072

7173
runs:
7274
using: "node20"

Diff for: run/src/main.ts

+4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ async function run() {
9898
core.info(" ");
9999
}
100100

101+
let suggestionsSkipped = false;
102+
101103
if (inputs.suggestions && success) {
102104
const resolved = await clearPriorSuggestions(client, pr);
103105

@@ -120,6 +122,7 @@ async function run() {
120122
: `${s.startLine}`;
121123
const location = `${s.path}:${line}`;
122124
core.warning(`[${location}]: Skipping suggestion: ${skipReason}`);
125+
suggestionsSkipped = true;
123126
return Promise.resolve();
124127
} else {
125128
n += 1;
@@ -140,6 +143,7 @@ async function run() {
140143
restyledHead: `restyled/${pr.headRef}`,
141144
restyledTitle: `Restyled ${pr.title}`,
142145
restyledBody: pullRequestDescription(pr.number),
146+
suggestionsSkipped,
143147
});
144148

145149
if (ec !== 0) {

Diff for: run/src/outputs.ts

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export type Outputs = {
2323
restyledHead: string;
2424
restyledTitle: string;
2525
restyledBody: string;
26+
suggestionsSkipped: boolean;
2627
};
2728

2829
export function setOutputs(outputs: Outputs): void {
@@ -33,4 +34,5 @@ export function setOutputs(outputs: Outputs): void {
3334
core.setOutput("restyled-head", outputs.restyledHead);
3435
core.setOutput("restyled-title", outputs.restyledTitle);
3536
core.setOutput("restyled-body", outputs.restyledBody);
37+
core.setOutput("suggestions-skipped", outputs.suggestionsSkipped);
3638
}

0 commit comments

Comments
 (0)