Repository navigation
ci(twenty-app): the plan and apply log in to Infisical over GitHub OIDC [FACT-1902] - #13
Conversation
…DC; no Twenty credential in the repo [FACT-1902]
The plan job read the Twenty key from a repository setting that was never set,
so it had skipped on every pull request ("no workspace credentials"). Now:
- build runs on every PR, forks included, with no credentials;
- plan runs for same-repository PRs in the `twenty-prod` environment, logs in
to Infisical with the job's OIDC token as a machine identity that may read
exactly one value (the Twenty key, prod), and FAILS when it cannot plan;
- apply logs in the same way.
Domain, identity id, project and workspace URL are repository variables. The
Infisical action is pinned to v1.0.18's commit.
Refs: FACT-1902
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
practical-bot
left a comment
There was a problem hiding this comment.
Review
Judged against the current FACT-1902 card, including its 2026-11-16 re-scope. This PR correctly covers the crm CI/OIDC slice; the separately described factory-side Brand seeding and live per-brand board result remain outstanding work on the card, not changes made by this diff.
The workflow grants id-token: write only to the plan and apply jobs, puts both jobs in twenty-prod, uses the configured Infisical identity/project/domain variables, requests only TWENTY_API_KEY, and keeps the key out of repository secrets. The Infisical action is pinned to the stated commit. Same-repository gating on plan prevents fork runs from attempting the environment/OIDC path while the credential-free build still runs for forks. Both apply paths retain --no-prune.
Claim ledger:
- “
pnpm guardis clean.” — PASS. Exact command:pnpm guard; output: 14 tests passed,guard: 76 files clean. - “The YAML parses.” — PASS-BY-CI. The
planandbuildjobs of run43957239776were created and completed successfully from this workflow, which requires GitHub to parse the workflow. - “It must log in over OIDC and print
twenty app plan --no-prune.” — PASS-BY-CI. Run43957239776, plan job133615122677, loggedmethod: oidc, injected secrets, then rantwenty app plan --path twenty-app --no-pruneand reportedNo changes. Twenty metadata matches your manifest. - “The apply logs in the same way.” — VERIFIED-BY-CODE. The apply job has the same pinned Infisical OIDC action, environment, and
id-token: write; its live execution is intentionally skipped in the PR run becauseworkflow_dispatch, confirmation, andTWENTY_APP_APPLY_ENABLEDgate it. - “The repository stores no credential.” — VERIFIED-BY-CODE/CONFIG CLAIM. The diff removes the old
secrets.TWENTY_API_KEYread and uses only repository variables for configuration; repository Settings cannot be inspected from this review workspace.
CI evidence: all rows from gh pr checks were read. build, check / test, and plan passed; apply was skipped as expected for a pull-request event. The exact-head CI jobs ran on 8603c737430637b94aebcba80b9281b65609be6d.
NEEDS VERIFICATION: one manual apply dispatch after merge, with TWENTY_APP_APPLY_ENABLED=true, completes successfully using the OIDC-injected key and leaves the workspace applied with --no-prune.
NEEDS VERIFICATION: factory-side Brand seeding from factory_brand_roster is idempotent, and the deployed “Leads by brand” view lists every existing opportunity under its brand.
REVIEW VERDICT: approve
REVIEWED DIFF: base=main files=1 lines=67
What
The
twenty-appplan job read the Twenty key from a repository setting that was never set, so it has skipped on every pull request ("no workspace credentials"). This PR gives the plan and the apply a real, credential-free login:twenty-prodenvironment. It logs in to Infisical with the job's GitHub OIDC token (id-token: write) and fetches only the Twenty key. It now fails when it can't plan, instead of skipping quietly.d2e351f).The identity (created 2026-11-16 by the owner, from a reviewed script)
crm-github-oidchas no organization-level access. It sits in the key's project with roleno-access, plus one additional privilege:describeSecretandreadValueon that single named value inprodat/.https://token.actions.githubusercontent.com, audiencehttps://github.com/PracticalWorks, subjectrepo:PracticalWorks@259778040/crm@1456078744:environment:twenty-prod. The repo uses GitHub's immutable subject format, read fromgh api repos/PracticalWorks/crm/actions/oidc/customization/sub.TWENTY_API_URL,INFISICAL_DOMAIN,INFISICAL_IDENTITY_ID,INFISICAL_PROJECT_SLUG. The repo stores no credential.Proof
planjob is the live test. It must log in over OIDC and printtwenty app plan --no-pruneagainst the workspace. The expected result is no changes, since fix(events): the app role reads Opportunities, so Twenty delivers their events to the hooks [FACT-1882] #12's apply matches.pnpm guardis clean. The YAML parses.Refs: FACT-1902
🤖 Generated with Claude Code