Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 63e8a16

Browse files
committed
Remove single dispatch
[changelog:changed]
1 parent e8bb2e6 commit 63e8a16

File tree

4 files changed

+170
-723
lines changed

4 files changed

+170
-723
lines changed

lib/events/rebaseOnPullRequestComment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ ${github.formatMarkers(ctx)}`,
8383
}
8484
try {
8585
const args = [];
86-
if (ctx.configuration[0]?.parameters?.strategy) {
87-
args.push("-X", ctx.configuration[0].parameters.strategy);
86+
if (ctx.configuration?.parameters?.strategy) {
87+
args.push("-X", ctx.configuration.parameters.strategy);
8888
}
8989
await project.exec("git", [
9090
"rebase",

lib/events/rebaseOnPush.ts

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
log,
2222
repository,
2323
secret,
24+
status,
2425
} from "@atomist/skill";
2526
import { codeLine } from "@atomist/slack-messages";
2627
import * as _ from "lodash";
@@ -115,16 +116,17 @@ ${github.formatMarkers(ctx)}`,
115116
}** couldn't be checked out
116117
${github.formatMarkers(ctx)}`,
117118
);
118-
results.push({
119-
code: 0,
120-
reason: `Pull request [${pr.repo.owner}/${pr.repo.name}#${pr.number}](${pr.url}) rebase failed because branch ${pr.branchName} couldn't be checked out`,
121-
});
119+
results.push(
120+
status.success(
121+
`Pull request [${pr.repo.owner}/${pr.repo.name}#${pr.number}](${pr.url}) rebase failed because branch ${pr.branchName} couldn't be checked out`,
122+
),
123+
);
122124
continue;
123125
}
124126
try {
125127
const args = [];
126-
if (ctx.configuration[0]?.parameters?.strategy) {
127-
args.push("-X", ctx.configuration[0].parameters.strategy);
128+
if (ctx.configuration?.parameters?.strategy) {
129+
args.push("-X", ctx.configuration.parameters.strategy);
128130
}
129131
await project.exec("git", [
130132
"rebase",
@@ -153,10 +155,11 @@ ${github.formatMarkers(ctx)}`,
153155
${conflicts.map(c => `- ${codeLine(c)}`).join("\n")}
154156
${github.formatMarkers(ctx)}`,
155157
);
156-
results.push({
157-
code: 0,
158-
reason: `Pull request [${pr.repo.owner}/${pr.repo.name}#${pr.number}](${pr.url}) rebase failed because of conflicts`,
159-
});
158+
results.push(
159+
status.success(
160+
`Pull request [${pr.repo.owner}/${pr.repo.name}#${pr.number}](${pr.url}) rebase failed because of conflicts`,
161+
),
162+
);
160163
continue;
161164
}
162165

@@ -179,10 +182,11 @@ ${github.formatMarkers(ctx)}`,
179182
}** errored
180183
${github.formatMarkers(ctx)}`,
181184
);
182-
results.push({
183-
code: 0,
184-
reason: `Pull request [${pr.repo.owner}/${pr.repo.name}#${pr.number}](${pr.url}) rebase failed because force push errored`,
185-
});
185+
results.push(
186+
status.success(
187+
`Pull request [${pr.repo.owner}/${pr.repo.name}#${pr.number}](${pr.url}) rebase failed because force push errored`,
188+
),
189+
);
186190
continue;
187191
}
188192

@@ -196,17 +200,18 @@ ${github.formatMarkers(ctx)}`,
196200
)} by @${push.after.author.login}
197201
${github.formatMarkers(ctx)}`,
198202
);
199-
results.push({
200-
code: 0,
201-
reason: `Pull request [${pr.repo.owner}/${pr.repo.name}#${
202-
pr.number
203-
}](${
204-
pr.url
205-
}) was successfully rebased onto [${push.after.sha.slice(
206-
0,
207-
7,
208-
)}](${push.after.url}) by @${push.after.author.login}`,
209-
});
203+
results.push(
204+
status.success(
205+
`Pull request [${pr.repo.owner}/${pr.repo.name}#${
206+
pr.number
207+
}](${
208+
pr.url
209+
}) was successfully rebased onto [${push.after.sha.slice(
210+
0,
211+
7,
212+
)}](${push.after.url}) by @${push.after.author.login}`,
213+
),
214+
);
210215
}
211216
}
212217

@@ -216,11 +221,11 @@ ${github.formatMarkers(ctx)}`,
216221
reason: results.map(r => r.reason).join("\n"),
217222
};
218223
} else {
219-
return {
220-
visibility: "hidden",
221-
code: 0,
222-
reason: `No open pull request that needs rebasing against branch ${push.branch}`,
223-
};
224+
return status
225+
.success(
226+
`No open pull request that needs rebasing against branch ${push.branch}`,
227+
)
228+
.hidden();
224229
}
225230
};
226231

0 commit comments

Comments
 (0)