CI/CD Automation
Zephyr requires authenticated CI/CD pipelines to publish updates. Use CI tokens for deployment authentication.
Do not use personal tokens with ZE_SECRET_TOKEN for deployments. Existing pipelines that use personal tokens or server tokens should migrate to CI tokens.
Creating a CI Token
First, create a CI token from Organization Settings > CI tokens. This token will be used to authenticate your CI/CD pipeline with Zephyr. See CI Tokens for how tokens are exchanged, which CI providers are supported, and how deployments are attributed.
GitHub Actions
Adding the GitHub Secret
Add your Zephyr token as a repository secret:
- Navigate to your GitHub repository
- Go to Settings → Secrets and variables → Actions
- Click New repository secret
- Set:
- Name:
ZEPHYR_CI_TOKEN - Secret: Your Zephyr CI token
- Name:
Using in Workflow
The secret must be assigned to the ZE_CI_TOKEN environment variable:
GitLab CI/CD
Adding the GitLab Variable
Add your Zephyr token as a CI/CD variable:
- Navigate to your GitLab project
- Go to Settings → CI/CD
- Expand the Variables section
- Click Add variable
- Set:
- Key:
ZE_CI_TOKEN - Value: Your Zephyr CI token
- Type: Variable
- Environment scope: All (or specify environments)
- Protect variable: ✓ (recommended)
- Mask variable: ✓ (recommended)
- Key:
Using in Pipeline
Fail the build on Zephyr errors
By default, Zephyr logs plugin and deployment errors without failing your application build. In CI/CD, set ZE_FAIL_BUILD to true so Zephyr rethrows these errors and the build exits with a failure status:
Only the value true enables this behavior. If ZE_FAIL_BUILD is unset or set to any other value, Zephyr logs the error and allows the build to continue.
Plugin Behavior
When the Zephyr plugin detects the ZE_CI_TOKEN environment variable, it will:
- Use the token for automatic authentication
- Skip the interactive login step
- Display this message in the console:
Troubleshooting
Token not found
- Ensure the variable name is exactly
ZE_CI_TOKEN - Verify the variable is available in the job environment
- Check that the token hasn't expired
GitHub Actions Issues
- Make sure the secret is added to the correct repository
- Verify the secret name matches what's referenced in the workflow
GitLab CI/CD Issues
- If using protected variables, ensure your pipeline runs on protected branches
- Masked variables won't appear in logs (recommended for security)
- Check variable scope matches your branch/environment