An open API service indexing awesome lists of open source software.

https://github.com/git-stunts/docker-guard

Minimal guard that enforces Git Stunts tests/benchmarks Docker-only policy. Complete with banner, env detection, and test-friendly hooks.
https://github.com/git-stunts/docker-guard

dev-tools docker git git-stunts nodejs npm-package safety security testing

Last synced: about 2 months ago
JSON representation

Minimal guard that enforces Git Stunts tests/benchmarks Docker-only policy. Complete with banner, env detection, and test-friendly hooks.

Awesome Lists containing this project

README

          

# @git-stunts/docker-guard

[![npm version](https://img.shields.io/npm/v/@git-stunts/docker-guard.svg)](https://www.npmjs.com/package/@git-stunts/docker-guard)
[![CI](https://github.com/git-stunts/plumbing/actions/workflows/ci.yml/badge.svg)](https://github.com/git-stunts/plumbing/actions/workflows/ci.yml)
[![license](https://img.shields.io/npm/l/@git-stunts/plumbing.svg)](LICENSE)

Tiny guard that ensures tests and benchmarks only execute inside Docker. Each git-stunts package can import the guard, then call `ensureDocker()` before any runtime work begins.

## Usage

```javascript
import { ensureDocker } from '@git-stunts/docker-guard';

ensureDocker();
```

You can also pass overrides for testing:

```javascript
import { ensureDocker } from '@git-stunts/docker-guard';

ensureDocker({
env: { GIT_STUNTS_DOCKER: '1' },
logger: () => {},
exit: () => {}
});
```
![20260108_0910_Image Generation_simple_compose_01kef9bb8je9rtrptm6nrapw19](https://github.com/user-attachments/assets/86d76e23-24f6-4672-a726-3489e1b1d479)