Skip to main content
Deploying code without verifying that your service is actually healthy afterwards is a gap that pulse wait closes. After your deployment step completes, run pulse wait with your production monitor’s ID and the CLI will block until PulseGuard confirms the monitor is UP — or fail the pipeline if it doesn’t recover in time. This works with GitHub Actions, GitLab CI, CircleCI, and any CI system that respects process exit codes.

The pulse wait command

pulse wait polls the PulseGuard API on a configurable interval until the target monitor’s status transitions to UP, or until the timeout is reached. It exits with code 0 on success and code 1 on timeout or error, so your CI system automatically marks the step as failed if the service doesn’t recover.

Flags

Examples

Wait up to 5 minutes (the default):
Wait up to 10 minutes with a 30-second polling interval:
Get a machine-readable result for post-deploy scripts:
On success the JSON output looks like:
On timeout:

Exit codes

pulse wait polls the PulseGuard API to read your monitor’s reported status — it does not make any direct requests to your service. All traffic originates from PulseGuard’s own check infrastructure.

GitHub Actions

Add a post-deploy step that blocks the workflow until your production monitor is healthy. Store your API key as a repository secret named PULSEGUARD_API_KEY and your monitor ID as a repository variable named MONITOR_ID. A dedicated pulse auth login step authenticates the CLI before any monitoring commands run.
.github/workflows/deploy.yml
If the monitor does not return UP within 300 seconds, the pulse wait step exits with code 1 and GitHub Actions marks the workflow run as failed, preventing any subsequent steps from running.

GitLab CI

The same pattern works in GitLab CI. Set PULSEGUARD_API_KEY and MONITOR_ID as masked CI/CD variables in your project settings. The pulse auth login call at the start of the script authenticates the CLI for the rest of the job.
.gitlab-ci.yml

CircleCI

In CircleCI, store your API key in a context or as a project-level environment variable, then add a pulse wait call after your deployment script:
.circleci/config.yml

Best practices

Follow these guidelines to get the most reliable results from pulse wait in your pipelines:
1

Store your API key as a secret

Always store your PulseGuard API key as a masked/protected CI secret (for example PULSEGUARD_API_KEY in GitHub or GitLab). Pass it to pulse auth login --key $PULSEGUARD_API_KEY at the start of your job. Never hardcode an API key in your pipeline configuration file or commit it to source control.
2

Use a read-only API key for CI

Create a dedicated API key for your CI pipelines with a descriptive name (for example ci-pipeline-prod). A read-only key is sufficient for pulse wait and pulse monitors list, and limits the blast radius if the key is ever exposed.
3

Set a realistic timeout

Measure how long your service typically takes to become healthy after a deployment and add a generous buffer. If your service is usually ready in 60 seconds, a --timeout 180 gives you 3× headroom without blocking the pipeline indefinitely.
4

Parse JSON output in post-deploy scripts

If you have a post-deploy notification or rollback script, use pulse wait --json and pipe the output to jq to extract the monitor name, status, and last-check timestamp for richer diagnostics.
Setting --timeout higher than 600 has no effect — the CLI enforces a maximum of 600 seconds. Design your deployment process so that a healthy service becomes UP well within this window.

Combining with Monitoring as Code

For a fully automated workflow, combine pulse monitors apply with pulse wait in the same pipeline. Apply your YAML configuration first to ensure monitor definitions are up to date, deploy your application, then gate on the monitor becoming healthy:
This approach means your monitor configuration, application code, and deployment verification all live in the same repository and evolve together.