ci(mcp): run the MCP registry publish in the mcp-registry environment (#7966)

This commit is contained in:
Xuanru Li
2026-11-16 21:54:12 +00:00
committed by GitHub
parent 2a28e43685
commit 45ff3526c0
2 changed files with 16 additions and 1 deletions
+2 -1
View File
@@ -15,8 +15,9 @@ on:
jobs:
publish:
# The registry trusts any OIDC token from this repo, so only main may request one.
# The environment admits only main.
if: github.ref == 'refs/heads/main'
environment: mcp-registry
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
@@ -162,3 +162,17 @@ test("a job that reads a stored secret binds an environment", () => {
);
assert.deepEqual(unbound, []);
});
test("a job that can request an OIDC token binds an environment", () => {
const unbound = workflows.flatMap(({ file, doc }) =>
Object.entries(doc.jobs ?? {})
.filter(([, job]) => {
const permissions = job.permissions ?? doc.permissions ?? {};
return (
(permissions === "write-all" || permissions["id-token"] === "write") && !job.environment
);
})
.map(([name]) => `${file} ${name}`),
);
assert.deepEqual(unbound, []);
});