# What Triggers the Audit Job in the CI/CD Workflow: Path-Based Automation Explained

> Discover what triggers the audit job in your CI/CD workflow. Learn how path-based automation in curriculum.yml simplifies content and configuration changes.

- Repository: [Rohit Ghumare/ai-engineering-from-scratch](https://github.com/rohitg00/ai-engineering-from-scratch)
- Tags: how-to-guide
- Published: 2026-09-11

---

**The `audit` job triggers whenever a push or pull request to the `main` branch modifies curriculum content, audit scripts, or site configuration files specified in the [`.github/workflows/curriculum.yml`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/.github/workflows/curriculum.yml) path filters.**

The `audit` job is a critical component of the `curriculum` GitHub Actions workflow in the `rohitg00/ai-engineering-from-scratch` repository. It ensures curriculum integrity by automatically running invariant checks and site builds whenever relevant source code changes.

## How the Audit Job Is Triggered

The workflow defines **two primary event triggers** that activate the `audit` job, both restricted by path filters to avoid unnecessary executions.

### Push Events to Main

When code is **pushed** to the `main` branch, GitHub evaluates the changed files against the `paths` list defined in the `on.push` configuration (lines 4‑78 of [`.github/workflows/curriculum.yml`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/.github/workflows/curriculum.yml)). If any modified file matches the specified patterns, the workflow initiates and the `audit` job begins execution.

### Pull Request Events Targeting Main

Similarly, when a **pull request** is opened, synchronized, or reopened targeting the `main` branch, GitHub checks the PR's file changes against the `on.pull_request.paths` filter. The `audit` job runs only if the PR includes modifications to tracked curriculum or script files.

## Path Filters That Activate the Audit Job

The workflow uses specific **glob patterns** to determine relevance. The `audit` job triggers when changes occur in:

- **Curriculum content**: `phases/**`, `certifications/**`, `skills/**`, and `.claude/skills/**` directories containing lesson and certification source files
- **Audit scripts**: All Python utilities in `scripts/` including [`audit_lessons.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/audit_lessons.py) and [`audit_certifications.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/audit_certifications.py)
- **Site generation**: Static site builder files such as `site/**` and [`site/build.js`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/site/build.js)
- **Repository metadata**: Core documentation like [`README.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/README.md), [`ROADMAP.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/ROADMAP.md), and files within `glossary/**`
- **Configuration**: Deployment and language configuration files including [`vercel.json`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/vercel.json)

If a commit modifies files outside these scopes—such as unrelated documentation or test data—the workflow remains dormant and the `audit` job skips execution.

## What the Audit Job Executes

Once triggered by path-filtered events, the `audit` job performs a series of validation steps defined in the `jobs:` section of the workflow. According to the source code, this includes:

- **Python invariant checks**: Running [`scripts/audit_lessons.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_lessons.py) to validate lesson structure and [`scripts/audit_certifications.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_certifications.py) to verify certification requirements
- **Test suites**: Executing automated tests against the curriculum codebase
- **De-bias validation**: Running specialized checks to ensure content fairness and consistency
- **Site build process**: Executing [`site/build.js`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/site/build.js) to generate the static site and verify the build completes without errors

These steps ensure that any changes to the curriculum meet quality standards before deployment.

## Code Example: Trigger Configuration

The path-based logic is implemented directly in the workflow YAML:

```yaml

# .github/workflows/curriculum.yml

on:
  push:
    branches: [main]
    paths:
      - "phases/**"
      - "certifications/**"
      - "skills/**"
      - ".claude/skills/**"
      - "scripts/audit_lessons.py"
      - "scripts/audit_certifications.py"
      - "site/**"
      - "site/build.js"
      - "README.md"
      - "ROADMAP.md"
      # Additional paths...

  pull_request:
    branches: [main]
    paths:
      - "phases/**"
      - "certifications/**"
      - "skills/**"
      - ".claude/skills/**"
      - "scripts/audit_lessons.py"
      - "scripts/audit_certifications.py"
      - "site/**"
      - "site/build.js"
      - "README.md"
      - "ROADMAP.md"
      # Additional paths...

```

Both the `push` and `pull_request` triggers share identical path filters, ensuring consistent behavior whether integrating directly or through peer review.

## Summary

- The `audit` job is defined in [`.github/workflows/curriculum.yml`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/.github/workflows/curriculum.yml) and triggers exclusively on **push** and **pull_request** events targeting the `main` branch.
- **Path filters** restrict execution to changes affecting curriculum content (`phases/**`, `certifications/**`, `skills/**`), audit scripts ([`scripts/audit_lessons.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_lessons.py), [`scripts/audit_certifications.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_certifications.py)), site files ([`site/build.js`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/site/build.js)), and core configuration.
- When activated, the job runs **Python audit scripts**, **test suites**, **de-bias checks**, and **site builds** to enforce curriculum integrity.
- Changes outside the specified paths—such as unrelated documentation updates—do not trigger the workflow, conserving CI/CD resources.

## Frequently Asked Questions

### Does the audit job run on every commit to the repository?

No. The `audit` job runs only when commits modify files within the specific paths defined in the workflow's `paths` filter. If you commit changes to files outside the curriculum, scripts, or site directories, the workflow remains inactive and the job does not execute.

### What specific files trigger the audit job when modified?

Key files include curriculum content in `phases/**`, `certifications/**`, and `skills/**`; audit utilities like [`scripts/audit_lessons.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_lessons.py) and [`scripts/audit_certifications.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_certifications.py); site generation logic in [`site/build.js`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/site/build.js); and configuration files such as [`vercel.json`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/vercel.json), [`README.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/README.md), and [`ROADMAP.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/ROADMAP.md). The complete list encompasses approximately 15+ path patterns defined in lines 4‑78 of the workflow configuration.

### Can the audit job be triggered manually?

The analysis of [`.github/workflows/curriculum.yml`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/.github/workflows/curriculum.yml) focuses on automated triggers for push and pull request events. The repository does not appear to configure `workflow_dispatch` triggers in the provided source snippet, meaning the job relies on file changes to activate rather than manual execution through the GitHub Actions interface.

### What happens if the audit job detects issues?

While the analysis emphasizes the job's execution of invariant checks through [`audit_lessons.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/audit_lessons.py) and [`audit_certifications.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/audit_certifications.py), a failure in these Python scripts or the site build process ([`site/build.js`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/site/build.js)) would typically result in a failed workflow status. This blocks the pull request from merging or indicates a broken build on the `main` branch, alerting maintainers to curriculum inconsistencies.