Merge pull request #318 from pikasTech/fix/313-aipod-github-ssh-projection
Pipelines as Code CI / agentrun-nc01-v02-ci-352f359749029579e510595afd6c5c3e65f6573e Success

fix: 收敛 Artificer GitHub SSH 必需键
This commit is contained in:
Lyon
2026-07-12 15:27:21 +08:00
committed by GitHub
2 changed files with 5 additions and 3 deletions
-1
View File
@@ -68,7 +68,6 @@ spec:
keys:
- id_ed25519
- known_hosts
- config
projection:
kind: volume
mountPath: /home/agentrun/.ssh
+5 -2
View File
@@ -59,7 +59,10 @@ const selfTest: SelfTestCase = async (context) => {
const toolCredentials = secretScope.toolCredentials as JsonRecord[];
assert.equal(toolCredentials.some((item) => item.tool === "github" && ((item.projection as JsonRecord).kind) === "env" && ((item.projection as JsonRecord).envName) === "GH_TOKEN" && ((item.secretRef as JsonRecord).name) === "agentrun-v01-tool-github-pr"), true);
assert.equal(toolCredentials.some((item) => item.tool === "unidesk-ssh" && ((item.projection as JsonRecord).envName) === "UNIDESK_SSH_CLIENT_TOKEN"), true);
assert.equal(toolCredentials.some((item) => item.tool === "github" && ((item.projection as JsonRecord).kind) === "volume" && ((item.projection as JsonRecord).mountPath) === "/home/agentrun/.ssh"), true);
const githubSshCredential = toolCredentials.find((item) => item.tool === "github" && item.purpose === "github-ssh") as JsonRecord | undefined;
assert.equal(((githubSshCredential?.projection as JsonRecord).kind), "volume");
assert.equal(((githubSshCredential?.projection as JsonRecord).mountPath), "/home/agentrun/.ssh");
assert.deepEqual(((githubSshCredential?.secretRef as JsonRecord).keys), ["id_ed25519", "known_hosts"]);
const bundle = task.resourceBundleRef as JsonRecord;
assert.equal(Object.hasOwn(bundle, "gitMirror"), false);
const bundles = bundle.bundles as JsonRecord[];
@@ -107,7 +110,7 @@ const selfTest: SelfTestCase = async (context) => {
assert.equal(commands.some((item) => item.includes("aipod-specs render <name>")), true);
assert.equal(commands.some((item) => item.includes("queue submit --aipod <name>")), true);
assertNoSecretLeak(submitPlan);
return { name: "aipod-spec", tests: ["aipod-spec-yaml-parser-runtime-compatible", "aipod-spec-artificer-image-ref-render", "aipod-spec-primary-workspace-contract", "aipod-spec-artificer-github-url-render", "aipod-spec-git-mirror-url", "git-fetch-stderr-classification", "resource-bundle-source-authority-validation", "resource-bundle-target-conflict-validation", "queue-submit-aipod-dry-run", "aipod-cli-help"] };
return { name: "aipod-spec", tests: ["aipod-spec-yaml-parser-runtime-compatible", "aipod-spec-artificer-image-ref-render", "aipod-spec-primary-workspace-contract", "aipod-spec-artificer-github-url-render", "aipod-spec-artificer-github-ssh-required-keys", "aipod-spec-git-mirror-url", "git-fetch-stderr-classification", "resource-bundle-source-authority-validation", "resource-bundle-target-conflict-validation", "queue-submit-aipod-dry-run", "aipod-cli-help"] };
} finally {
await new Promise<void>((resolve) => server.server.close(() => resolve()));
}