SfSkills Domains Docs GitHub

Home / devops / pipeline-secrets-management

pipeline-secrets-management

Store and inject Salesforce auth URLs, JWT keys, and API credentials into CI without leaking them. NOT for authoring the GitHub Actions workflow itself — use devops/github-actions-for-salesforce. NOT for secrets Apex reads — use apex/apex-secrets-and-protected-cmdt.

Open the skill folder on GitHub


Pipeline Secrets Management

Salesforce CI pipelines need to authenticate to orgs (sandboxes, UAT, prod). The safest pattern is a JWT bearer flow with a Connected App per pipeline stage and the private key stored as a base64 secret in the CI provider's vault. This skill defines naming, rotation, and leak-detection procedures.

  1. Create one Connected App per CI stage (CI-Dev, CI-UAT, CI-Prod) with JWT flow enabled; export certificate + private key.
  2. Store the PEM private key as a CI secret (GitHub Actions: repository secret, base64-encoded).
  3. In the pipeline, write the key to a temp file, run sf org login jwt --client-id ... --username ... --jwt-key-file ..., then delete the temp file.
  4. Rotate the private key every 90 days via a scheduled task; invalidate the previous certificate in the Connected App.
  5. Enable GitHub secret scanning and a pre-commit hook that blocks force:// auth URL patterns.

Key Considerations

Worked Examples (see references/examples.md)

Common Gotchas (see references/gotchas.md)

Top LLM Anti-Patterns (full list in references/llm-anti-patterns.md)

Official Sources Used

Package files