Skip to content

PGRun CI v1.0.0

Choose a tag to compare

@alexshapalov alexshapalov released this 16 Oct 06:37
· 5 commits to main since this release

Test every pull request against its own production-like PostgreSQL database, in one workflow step.

What it does

  • Production-like mode: each run gets a copy-on-write PGX branch of your sanitized Safe Copy, ready in about 2 seconds. Your migrations run on it, then the data is compared before and after:

    • rows and non-null values;
    • dropped tables and columns;
    • NOT VALID constraints existing rows violate, and invalid indexes;
    • Rails references and polymorphic type columns;
    • pending migrations.

    Your own tests can run on the same branch with test-command.

  • Fast mode: your whole suite in parallel. Each worker gets an empty branch with the production schema, built from a schema-only template. When the project's branch quota is full, runs wait for capacity instead of failing.

  • Intentional data loss: approved in PGRun by an account manager, for one migration, bound to the SHA-256 of its file. A pull request cannot approve its own data loss.

  • Cleanup: branches are deleted on success, failure, timeout and cancellation.

Security

  • Credential: a project-scoped CI token with an explicit expiry of 30, 90, 180 or 365 days.
    • It reaches only the branches it created itself.
    • It cannot change data protection, Safe Copies or template seeds.
  • Fork pull requests: they get no secrets. The documented if: skips them, and an empty token stops the run before any API call. pull_request_target is refused.
  • Production data: never reached from CI. Branches come only from the sanitized Safe Copy or the schema-only template.
  • Supply chain: the pgrun CLI is checksum-pinned, and ruby/setup-ruby is pinned by commit. The action runs on Node 24.

Use it

      - uses: pgrundev/ci-action@v1
        with:
          token: ${{ secrets.PGRUN_API_TOKEN }}
          mode: production-like

For an immutable pin, use this release's commit:

      - uses: pgrundev/ci-action@5939ebcdc3229bad6ef1b392427973735dbe755d  # v1.0.0

Requirements

  • A PGRun project with Protect approved and a Safe Copy.
  • A project CI token stored as the PGRUN_API_TOKEN secret.
  • Rails is the first supported framework.

See the README and security model.