Skip to main content

Installing Gruntwork Drift Detection

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

To upgrade an existing repository and enable Gruntwork 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. Gruntwork 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:
pipelines_drift_detection_filter: ${{ inputs.pipelines_drift_detection_filter }}
pipelines_drift_detection_branch: ${{ inputs.pipelines_drift_detection_branch }}

Step 3 - Run your first Gruntwork Drift Detection job

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