Complete drift detection and remediation pipeline via GitHub Agentic Workflow

Open
#18 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
azure, github-actions, javascript, shell, vscode

Research direction

Start with the existing azure-drift-detector skill and inspect .azure/deployments/ for template.json and state.json. Read the gh-aw workflow requirements, author .github/workflows/drift-detection.md, and verify it compiles with gh aw compile. Done means scheduled drift checks, categorized PR findings, interactive @git-ape drift support, and no missing skill scripts.

Written by the indexing model from the issue text.

Description

enhancement

Description

The manifesto states: "Agents detect drift, propose fixes, generate plans, request approval, and apply remediations." The azure-drift-detector skill exists but is incomplete — missing scripts, no workflow, no auto-remediation. Rather than a traditional scheduled GitHub Actions workflow, this should be implemented as a GitHub Agentic Workflow (gh-aw) — a scheduled agent that runs periodically, inspects deployments, compares state, and opens PRs to resolve drift.

Related: #12 (GitHub Agentic Workflows adoption)

Implementation Approach: gh-aw Agentic Workflow

The drift detection workflow is authored as a Markdown file (.github/workflows/drift-detection.md) and compiled via gh aw compile into a hardened GitHub Actions workflow. The agent:

  1. Runs on a schedule (e.g., daily or weekly via cron).
  2. Iterates over all tracked deployments in .azure/deployments/.
  3. For each deployment with state.json status succeeded, queries live Azure resource state via az CLI.
  4. Compares live state against the stored template.json + state.json.
  5. If drift is detected:
    • Creates a branch with an updated drift report.
    • Updates the template or state to reconcile (depending on drift category).
    • Opens a PR with the drift findings, categorized by severity.
    • PR includes: what changed, why it likely changed (policy remediation, manual edit, platform update), and proposed fix.
  6. If no drift: logs clean status.

Scope

  1. Complete azure-drift-detector skill — Replace missing detect-drift.sh with az CLI commands in the skill procedure. Ensure it can be invoked by both the interactive agent and the agentic workflow.
  2. drift-detection.md agentic workflow — Author the gh-aw Markdown workflow with schedule trigger, Azure OIDC login, and drift detection logic. Compile to .github/workflows/ via gh aw compile.
  3. Drift categorization — Categorize drift by likely cause: (a) manual Portal change, (b) Azure Policy remediation, (c) platform update, (d) unknown.
  4. PR-based remediation — Drift resolution is always via PR: agent proposes template or state update, human reviews and merges.
  5. @git-ape drift interactive command — For on-demand drift checks in VS Code chat.

Acceptance Criteria

  • drift-detection.md agentic workflow authored and compiles via gh aw compile.
  • Workflow runs on schedule, iterates deployments, detects drift.
  • Drift findings opened as PRs with categorized changes.
  • @git-ape drift <deployment-id> works interactively.
  • Drift report categorizes changes by severity and likely cause.
  • azure-drift-detector skill is functional (no missing scripts).
Dominant language
JavaScript
Stars
269
Forks
45
Avg merge
1d 4h
Merged PRs (30d)
15

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/git-ape

All issues in Azure/git-ape

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.