Overview
Check Image is available as a GitHub Action that validates container images directly in your CI/CD workflows. The action downloads the check-image binary from GitHub Releases and runs natively on the GitHub runner, providing full access to the Docker daemon for local image validation.Quick Start
Action Inputs
All inputs are optional exceptimage.
Required Inputs
| Input | Description | Example |
|---|---|---|
image | Container image to validate | nginx:latest, ghcr.io/org/app:1.0 |
Configuration Inputs
| Input | Description | Default |
|---|---|---|
config | Path to config file for the all command | - |
checks | Comma-separated list of checks to run (mutually exclusive with skip) | - |
skip | Comma-separated list of checks to skip (mutually exclusive with checks) | - |
fail-fast | Stop on first check failure | false |
Check-Specific Inputs
| Input | Description | Default |
|---|---|---|
max-age | Maximum image age in days | 90 |
max-size | Maximum image size in MB | 500 |
max-layers | Maximum number of layers | 20 |
allowed-ports | Comma-separated allowed ports or @file path | - |
allowed-platforms | Comma-separated allowed platforms or @file path | - |
registry-policy | Path to registry policy file | - |
labels-policy | Path to labels policy file | - |
secrets-policy | Path to secrets policy file | - |
skip-env-vars | Skip environment variable checks in secrets detection | false |
skip-files | Skip file system checks in secrets detection | false |
allow-shell-form | Allow shell form for entrypoint or cmd | false |
Other Inputs
| Input | Description | Default |
|---|---|---|
log-level | Log level (trace, debug, info, warn, error, fatal, panic) | info |
version | check-image version to use | 0.19.4 |
Action Outputs
The action provides two outputs for use in subsequent workflow steps:| Output | Description | Values |
|---|---|---|
result | Validation result | passed, failed, error |
json | Full JSON output from check-image | JSON string |
Basic Examples
All Checks (Default)
Specific Checks Only
Skip Specific Checks
Using Configuration Files
With Config File
.check-image/config.yaml):
With Policy Files
policies/registry-policy.yaml):
policies/labels-policy.json):
Step Summary
The action automatically generates a GitHub Actions Step Summary visible in the workflow run UI:Summary Table
Shows pass/fail status for each check:| Check | Result | Message |
|---|---|---|
| age | ✅ PASS | Image is less than 90 days old |
| size | ✅ PASS | Image size and layers within limits |
| root-user | ❌ FAIL | Image runs as root user |
Failed Check Details
Expanded details for failed checks:Full JSON Output
Collapsible section with complete JSON output for programmatic processing.Using Outputs
Accessing Result Output
Processing JSON Output
Conditional Steps
Soft Failure Mode
Usecontinue-on-error to prevent validation failures from stopping the workflow:
Complete Workflow Examples
Validate Built Image
Validate Registry Image with Auth
Multi-Image Validation
Fail-Fast Mode
Platform-Specific Validation
Validate Multi-Arch Image
With Platform Policy File
.github/allowed-platforms.yaml):
Private Registry Authentication
The action supports private registries through Docker authentication:Using docker/login-action
GitHub Container Registry (GHCR)
AWS ECR
Security Best Practices
Validate Before Push
Block Merges on Validation Failure
Make the validation check required in branch protection rules:Debugging
Enable Debug Logging
Enable GitHub Actions Debug Logging
Set repository secrets:ACTIONS_STEP_DEBUG = trueACTIONS_RUNNER_DEBUG = true
Inspect Action Outputs
Action Version Management
Pinning Versions
Dependabot Updates
Add to.github/dependabot.yml:
Troubleshooting
Action Not Found
Image Not Found
- Ensure image is built before validation
- Check image name and tag spelling
- Verify registry authentication for private images
Config File Not Found
actions/checkout@v4 runs before the check-image action.
Checks Require Configuration
Next Steps
Docker Integration
Use Check Image with Docker CLI
CI/CD Integration
Integrate with GitLab, CircleCI, Jenkins, and more