Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To make Great Expectations a pull-request check, run a repository-owned validation command in a GitHub Actions workflow triggered by pull_request. The command should load your GX project, validate a deliberate test or staging batch, and exit unsuccessfully when critical expectations fail. GitHub Actions then reports the job’s result on the pull request.

This is an integration pattern built from the documented capabilities of GX and GitHub Actions, not a universal, officially prescribed end-to-end recipe. The exact command and configuration depend on your GX version, data source, and repository.

How do I run Great Expectations in GitHub Actions?

Think of the integration as three connected pieces: the batch of data to check, the GX validation configuration, and the CI command that turns the validation outcome into a job status.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

1. Choose the batch

A Batch Definition describes how GX identifies the data to validate. For pull-request checks, use a representative, deterministic fixture or a safe staging batch. A mutable production query can produce inconsistent results across runs and may expose sensitive data. Checkpoint runs accept batch parameters that select data through the Validation Definition’s Batch Definition; they do not, by themselves, solve remote data access or credential management. See the GX documentation on Validation Definitions.

2. Connect expectations to the batch

An Expectation Suite holds the checks you want to apply. A Validation Definition connects that suite to a Batch Definition. A Checkpoint can run Validation Definitions and then execute Actions based on the results. This gives the project a clear separation between what should be true, which data is checked, and what should happen afterward. GX Core documentation currently identifies version 1.23.2; its Checkpoint-with-Actions procedure lists Python 3.10–3.14 as prerequisites. Treat those as documentation details, not proof that every combination is compatible: use the GX and Python versions pinned and supported by your own project.

Start from the current GX Checkpoint documentation and Validation Definition guidance. Older GX 0.18 examples use different configuration patterns; do not mix them with current Core APIs without intentionally following the older version’s documentation.

3. Make CI invoke validation

GitHub Actions workflows are composed of jobs and steps, and can run builds or tests for pull requests. Your repository should own the command that loads GX configuration, supplies any required batch parameters, runs validation, and returns a nonzero exit status when a critical check fails. A failed command makes its step—and therefore the job—fail, which reviewers can see in the pull request interface.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The following is illustrative YAML, not a tested drop-in workflow. Replace the paths, dependency installation, and command with those used by your repository and pinned GX version:

name: Data validation

on:
  pull_request:

permissions:
  contents: read

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@<REVIEWED_FULL_LENGTH_COMMIT_SHA>
      - uses: actions/setup-python@<REVIEWED_FULL_LENGTH_COMMIT_SHA>
        with:
          python-version: "<PROJECT_PYTHON_VERSION>"
      - name: Install pinned dependencies
        run: pip install -r requirements.txt
      - name: Validate data expectations
        run: python scripts/validate_data.py

The placeholders in this example are values you must choose; the command is a project-owned entry point, not a GX universal CLI command. It should translate the validation result into a process exit code, while keeping detailed diagnostics appropriate for the audience of the workflow logs. Confirm the workflow structure and pull-request trigger against GitHub’s pull_request workflow documentation.

What should fail the pull request?

Define which expectations are merge-blocking before wiring them into CI. A useful gate exits unsuccessfully for violations that mean the proposed change breaks a data contract; checks intended only for monitoring can remain visible without blocking. The CI command, not merely the presence of a GX suite, must propagate the relevant validation outcome into its exit status.

  • Keep the job summary concise: report pass or failure and the affected validation or expectation.
  • Use a controlled channel for fuller diagnostics where they include unexpected values or row-level information.
  • Do not print private records or sensitive unexpected values into logs visible to external contributors.

How should the workflow report results?

A failed or passing job status is the core reviewer signal. GX Checkpoint Actions can extend that signal by updating Data Docs, sending notifications, or running custom logic after validation. Choose actions according to who can access the resulting output: a useful detailed report is not useful if it discloses private data to a public pull request.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the PR-facing check brief and publish richer diagnostics only to an access-controlled destination. GX documents the available action concepts in its Checkpoint Actions guidance.

Which GitHub trigger is safe for contributor pull requests?

For validation that executes pull-request code and does not need secrets, use pull_request. GitHub documents that fork-originated pull-request workflows receive a read-only GITHUB_TOKEN and no other repository secrets by default. Repository settings for approving fork workflows can affect whether a run starts. See GitHub’s security guidance on secrets and fork pull requests.

Do not use pull_request_target as a shortcut to obtain secrets while checking out and running contributor-controlled code. That event uses the base repository workflow and can have privileged credentials; combining it with untrusted code creates the risk GitHub warns about. If a separate privileged operation is necessary, keep it separate from executing untrusted code, restrict token permissions, and expose only the secrets it needs. GitHub’s workflow security hardening guidance also recommends least privilege.

Pin and limit actions

Pin third-party actions to a reviewed, full-length commit SHA and audit their code and access. GitHub identifies a full-length SHA as the immutable way to reference an action release. Grant GITHUB_TOKEN only the permissions the workflow needs; the example grants read-only repository contents because its illustrative steps only check out code and run validation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the public-repository policy date

GitHub documentation states that a default policy blocking pull_request_target in public repositories is scheduled for enforcement on November 2, 2026, for affected repositories. That date is after the documentation’s October 7, 2026 snapshot, so enforcement should not be described as already in effect on that date. Check the current GitHub Actions repository policy documentation before relying on the schedule.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Local fixtures or remote staging data?

These choices trade off repeatability, realism, and access requirements; neither is right for every repository.

Approach Strength Trade-off
Deterministic local fixture Repeatable checks without querying a changing external dataset on every PR. May not capture the full behavior or scale of the live data source.
Safe staging batch Can reflect a more realistic source and schema. Requires controlled data access and credentials; results may vary if the batch changes.

Whichever you choose, make the selected batch explicit and ensure the workflow has only the access it needs. GX’s batch parameters select data for a validation; infrastructure, secrets, and permissions remain responsibilities of the repository and its CI environment.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.