CI/CD Recipes
Secure pipeline patterns for decrypting and injecting secrets without committing plaintext files.
Baseline Pattern
1. Store the key in your CI secret manager, never in the repository.
2. Install xenvsync in pipeline jobs.
3. Write the key at runtime with restricted permissions.
4. Run pull or run only in jobs that actually need secrets.
Warning: Prefer environment-scoped vaults (for example, staging and production) to reduce blast radius.
GitHub Actions
Workflow snippetyaml
GitLab CI
.gitlab-ci.yml snippetyaml
CircleCI
.circleci/config.yml snippetyaml
Bitbucket Pipelines
bitbucket-pipelines.yml snippetyaml
Use pull vs run
Use xenvsync pull when downstream tools require an actual .env file.
Use xenvsync run -- your-command when you want in-memory injection and no plaintext file output.