Docs / Integrations / CI/CD

CI/CD

Add nudge notifications to GitHub Actions, GitLab CI, and other CI/CD pipelines.

GitHub Actions

Add a nudge step after your deploy job to get notified the moment a workflow finishes. Store your API token as a repository secret named NUDGE_TOKEN.

.github/workflows/deploy.yml
name: Deploy on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Deploy to production run: ./deploy.sh # Notify on success - name: Nudge -- deployed if: success() run: | curl -s https://nudge.sh/${{{ secrets.NUDGE_TOKEN }}} \ -d status="deployed" \ -d label="${{{ github.repository }}}" # Notify on failure - name: Nudge -- failed if: failure() run: | curl -s https://nudge.sh/${{{ secrets.NUDGE_TOKEN }}} \ -d status="failed" \ -d label="${{{ github.repository }}}"

If you want a single notification regardless of outcome, use if: always() and pass the job status:

.github/workflows/deploy.yml (always notify)
- name: Nudge -- notify if: always() run: | curl -s https://nudge.sh/${{{ secrets.NUDGE_TOKEN }}} \ -d status="${{{ job.status }}}" \ -d label="${{{ github.repository }}}"
Adding the secret

Go to your repository Settings → Secrets and variables → Actions and add NUDGE_TOKEN as a repository secret. It will be available as ${{{ secrets.NUDGE_TOKEN }}} in all workflows.

GitLab CI

In GitLab CI, use after_script to send a nudge after your deploy job completes. Store your token as a CI/CD variable named NUDGE_TOKEN.

.gitlab-ci.yml
deploy: stage: deploy script: - ./deploy.sh after_script: - | if [ $CI_JOB_STATUS == "success" ]; then STATUS="deployed" else STATUS="failed" fi curl -s https://nudge.sh/$NUDGE_TOKEN \ -d status="$STATUS" \ -d label="$CI_PROJECT_PATH" only: - main
GitLab CI variables

Add NUDGE_TOKEN under Settings → CI/CD → Variables. Mark it as Masked so it does not appear in job logs. The built-in $CI_JOB_STATUS variable gives you the job outcome in after_script.

Generic CI

The pattern works in any CI system -- Jenkins, CircleCI, Bitbucket Pipelines, Travis, or a custom runner. The steps are always the same:

  1. Store your token as a secret -- every CI platform has a way to set masked environment variables.
  2. Add a curl step after your deploy or test command -- one line is all it takes.
bash
# Generic post-deploy nudge curl -s https://nudge.sh/$NUDGE_TOKEN \ -d status="deployed" \ -d label="my-app"
Never hardcode your token

Always store NUDGE_TOKEN as a secret or masked variable in your CI platform. Never commit it to your repository or paste it directly into pipeline config files.

Failure Notifications

Sometimes you only want a nudge when something goes wrong. Capture the exit code and send conditionally:

bash
# Only nudge on failure ./deploy.sh EXIT_CODE=$? if [ $EXIT_CODE -ne 0 ]; then curl -s https://nudge.sh/$NUDGE_TOKEN \ -d status="failed" \ -d exit_code=$EXIT_CODE \ -d label="deploy" fi # Preserve the original exit code for the CI runner exit $EXIT_CODE

In GitHub Actions, use separate steps with if: failure() to achieve the same thing declaratively:

.github/workflows/deploy.yml
- name: Deploy run: ./deploy.sh - name: Nudge on failure only if: failure() run: | curl -s https://nudge.sh/${{{ secrets.NUDGE_TOKEN }}} \ -d status="failed" \ -d label="${{{ github.repository }}}"

Next Steps