Skip to content

ci(twenty-app): the plan and apply log in to Infisical over GitHub OIDC [FACT-1902] - #13

Merged
practical-bot merged 1 commit into
mainfrom
ci/fact-1902-twenty-oidc
Nov 16, 2026
Merged

practical-bot merged 1 commit into
mainfrom
ci/fact-1902-twenty-oidc

Conversation

@jcotillo

Copy link
Copy Markdown
Contributor

What

The twenty-app plan 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:

  • build runs on every PR, forks included, with no credentials.
  • plan runs for same-repository PRs in the twenty-prod environment. 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.
  • apply logs in the same way.
  • The Infisical action is pinned to v1.0.18's commit (d2e351f).

The identity (created 2026-11-16 by the owner, from a reviewed script)

  • crm-github-oidc has no organization-level access. It sits in the key's project with role no-access, plus one additional privilege: describeSecret and readValue on that single named value in prod at /.
  • OIDC binding: issuer https://token.actions.githubusercontent.com, audience https://github.com/PracticalWorks, subject repo:PracticalWorks@259778040/crm@1456078744:environment:twenty-prod. The repo uses GitHub's immutable subject format, read from gh api repos/PracticalWorks/crm/actions/oidc/customization/sub.
  • Repository variables (config only): TWENTY_API_URL, INFISICAL_DOMAIN, INFISICAL_IDENTITY_ID, INFISICAL_PROJECT_SLUG. The repo stores no credential.

Proof

Refs: FACT-1902

🤖 Generated with Claude Code

…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>
@jcotillo jcotillo added the merge:queued Queued for the merge drain once Talos approves and CI is green label Nov 16, 2026
@jcotillo
jcotillo deployed to twenty-prod November 16, 2026 21:10 — with GitHub Actions Active

@practical-bot practical-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 guard is clean.” — PASS. Exact command: pnpm guard; output: 14 tests passed, guard: 76 files clean.
  • “The YAML parses.” — PASS-BY-CI. The plan and build jobs of run 43957239776 were 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. Run 43957239776, plan job 133615122677, logged method: oidc, injected secrets, then ran twenty app plan --path twenty-app --no-prune and reported No 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 because workflow_dispatch, confirmation, and TWENTY_APP_APPLY_ENABLED gate it.
  • “The repository stores no credential.” — VERIFIED-BY-CODE/CONFIG CLAIM. The diff removes the old secrets.TWENTY_API_KEY read 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

@practical-bot
practical-bot merged commit 99a12fa into main Nov 16, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
twenty-prod — 8603c737 Deployed Nov 16, 2026 by jcotillo via plan #6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge:queued Queued for the merge drain once Talos approves and CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants