fix(pac): skip shared repository reapply for secondary consumers

This commit is contained in:
Codex
2026-07-15 09:01:13 +02:00
parent b5a76f55ef
commit da5fe0bfe6
2 changed files with 7 additions and 1 deletions
@@ -1722,6 +1722,7 @@ function remoteScript(action: "apply" | "status" | "history" | "debug-step", pac
const admissionIdentity = pacAdmissionDesiredIdentity(target.id);
const rbacIdentity = pacConsumerRbacDesiredIdentity(target.id);
const consumerConfig = historyConsumerConfig(pac, consumer);
const repositoryOwner = pac.consumers.find((item) => item.repositoryRef === repository.id);
const env: Record<string, string> = {
UNIDESK_PAC_ACTION: action,
UNIDESK_PAC_EVALUATOR_B64: Buffer.from(readFileSync(evaluatorFile, "utf8"), "utf8").toString("base64"),
@@ -1743,6 +1744,7 @@ function remoteScript(action: "apply" | "status" | "history" | "debug-step", pac
UNIDESK_PAC_WEBHOOK_URL: webhookUrl,
UNIDESK_PAC_WEBHOOK_SECRET: secrets.webhookSecret,
UNIDESK_PAC_REPOSITORY_NAME: repository.name,
UNIDESK_PAC_REPOSITORY_APPLY: repositoryOwner?.id === consumer.id ? "1" : "0",
UNIDESK_PAC_REPOSITORY_URL: repository.url,
UNIDESK_PAC_SECRET_NAME: repository.secretName,
UNIDESK_PAC_TOKEN_KEY: repository.tokenKey,