Skip to main content

Installing Drift Detection

note

Pipelines Drift Detection is exclusively available to DevOps Foundations Enterprise customers on GitHub and GitLab.

For new pipelines repositories using the latest version of Pipelines, Drift Detection is installed automatically and requires no additional action.

To upgrade an existing repository and enable Drift Detection, follow these steps:

Step 1 - Ensure authentication is properly configured

Verify that the GitHub App is installed and in use for this repository. Drift Detection relies on permissions granted by the GitHub App and is not compatible with machine user tokens.

Step 2 - Set up the workflow file

Create a new workflow file in your repository at .github/workflows/pipelines-drift-detection.yml.

This directory is the same location as your other Pipelines workflows.

Add the following content to the workflow:

name: Pipelines Drift Detection
run-name: "[GWP]: Pipelines Drift Detection"
on:
# Uncomment to enable scheduled Drift Detection
# schedule:
# - cron: '15 12 * * 1'
workflow_dispatch:
inputs:
pipelines_drift_detection_filter:
description: Limit drift detection to units matching filter https://docs.gruntwork.io/2.0/docs/pipelines/guides/running-drift-detection#drift-detection-filter
type: string
pipelines_drift_detection_branch:
description: The branch name used for drift remediation PRs
default: drift-detection
type: string
permissions:
id-token: write

jobs:
GruntworkPipelines:
uses: gruntwork-io/pipelines-workflows/.github/workflows/pipelines-drift-detection.yml@v4
with:
path: ${{ inputs.path }}
branch-name: ${{ inputs.branch-name }}

Step 3 - Run your first drift detection job

Follow the instructions at Running Drift Detection to start using the new workflow.