Reuse Runner plugin capability checks (#20987)

This commit is contained in:
Nicky Leach authored and GitHub committed 2026-11-11 17:21:07 -08:00
1 parent 42fd790e80
commit 45170b0cac
8 files changed
+36 -18

No files matched your search

@@ -53,6 +53,7 @@ export function createPluginRunnerTaskOwner(input: {
onResumed?: (identity: DurableRecoveryIdentity) => Promise<void>;
onRetired?: (identity: DurableRecoveryIdentity) => Promise<void>;
githubBroker?: { url: string; token: string };
githubCredentialBrokerVersion?: 1;
adoptIdentity?: DurableRecoveryIdentity;
}) {
const taskId = input.taskId;
@@ -132,11 +133,8 @@ export function createPluginRunnerTaskOwner(input: {
requirements.identity[key as keyof DurableRecoveryIdentity] !== value))) {
throw new Error("Plugin Runner source reconciliation unavailable");
}
if (input.githubBroker) {
const description = await call({ kind: "describe" });
if (description.kind !== "description" || description.githubCredentialBrokerVersion !== 1) {
throw new Error("Update the environment plugin to support the GitHub credential broker v1");
}
if (input.githubBroker && input.githubCredentialBrokerVersion !== 1) {
throw new Error("Update the environment plugin to support the GitHub credential broker v1");
}
const result = await call(environmentTaskOperationSchema.parse({ kind: "prepare", requirements,
...(input.githubBroker ? { githubBroker: input.githubBroker } : {}),