GitHub Actions
Unentropy provides two GitHub Actions for automated metrics tracking and quality enforcement.
Actions Overview
Section titled “Actions Overview”| Action | Purpose | Context |
|---|---|---|
| track-metrics | Collect and store metrics | Main branch pushes |
| quality-gate | Evaluate PR against thresholds | Pull requests |
track-metrics
Section titled “track-metrics”Collects metrics, updates the database, and generates reports. Runs on main branch to build historical data.
Basic Usage
Section titled “Basic Usage”Inputs
Section titled “Inputs”storage-type
Section titled “storage-type”Type: string
Default: sqlite-local
Values: sqlite-local, sqlite-artifact, sqlite-s3
Storage backend for the metrics database.
S3 Configuration
Section titled “S3 Configuration”Required when storage-type is sqlite-s3:
s3-endpoint
Section titled “s3-endpoint”Type: string
Required: Yes (for S3)
S3-compatible endpoint URL.
s3-bucket
Section titled “s3-bucket”Type: string
Required: Yes (for S3)
S3 bucket name.
s3-region
Section titled “s3-region”Type: string
Required: Yes (for S3)
S3 region.
s3-access-key-id
Section titled “s3-access-key-id”Type: string
Required: Yes (for S3)
S3 access key ID from GitHub Secrets.
s3-secret-access-key
Section titled “s3-secret-access-key”Type: string
Required: Yes (for S3)
S3 secret access key from GitHub Secrets.
Artifact Configuration
Section titled “Artifact Configuration”Used when storage-type is sqlite-artifact:
artifact-name
Section titled “artifact-name”Type: string
Default: unentropy-metrics
Name of the database artifact.
artifact-branch-filter
Section titled “artifact-branch-filter”Type: string
Default: ${{ github.ref_name }}
Branch to search for previous artifacts.
Other Inputs
Section titled “Other Inputs”config-file
Section titled “config-file”Type: string
Default: unentropy.json
Path to configuration file.
database-key
Section titled “database-key”Type: string
Default: unentropy-metrics.db
Database file key in storage.
report-name
Section titled “report-name”Type: string
Default: index.html
Generated report filename.
Outputs
Section titled “Outputs”success
Section titled “success”Type: boolean
Whether workflow completed successfully.
storage-type
Section titled “storage-type”Type: string
Storage backend type used.
database-location
Section titled “database-location”Type: string
Database storage location identifier.
database-size
Section titled “database-size”Type: string
Database file size in bytes.
metrics-collected
Section titled “metrics-collected”Type: number
Number of metrics collected.
duration
Section titled “duration”Type: number
Total workflow duration in milliseconds.
source-run-id
Section titled “source-run-id”Type: string
Available: Artifact storage only
Workflow run ID where previous artifact was found.
artifact-id
Section titled “artifact-id”Type: string
Available: Artifact storage only
ID of uploaded database artifact.
Examples
Section titled “Examples”GitHub Artifacts Storage
Section titled “GitHub Artifacts Storage”S3 Storage
Section titled “S3 Storage”quality-gate
Section titled “quality-gate”Evaluates PR metrics against baseline thresholds and posts results. Runs on pull requests.
Basic Usage
Section titled “Basic Usage”Inputs
Section titled “Inputs”storage-type
Section titled “storage-type”Type: string
Default: sqlite-s3
Values: sqlite-local, sqlite-artifact, sqlite-s3
Storage backend where baseline database is stored. Must match the storage used by track-metrics.
S3 Configuration
Section titled “S3 Configuration”Same as track-metrics action. Required when storage-type is sqlite-s3.
config-file
Section titled “config-file”Type: string
Default: unentropy.json
Path to configuration file.
database-key
Section titled “database-key”Type: string
Default: unentropy.db
Database file key in storage. Must match the key used by track-metrics.
quality-gate-mode
Section titled “quality-gate-mode”Type: string
Values: off, soft, hard
Override quality gate mode from config file:
off: Skip evaluationsoft: Evaluate and comment, don’t fail buildhard: Fail build on threshold violations
enable-pr-comment
Section titled “enable-pr-comment”Type: boolean
Default: true
Post/update PR comment with results.
pr-comment-marker
Section titled “pr-comment-marker”Type: string
Default: <!-- unentropy-quality-gate -->
HTML marker to identify quality gate comment.
max-pr-comment-metrics
Section titled “max-pr-comment-metrics”Type: number
Default: 30
Maximum metrics to show in PR comment.
output-file
Section titled “output-file”Type: string
Default: .unentropy/quality-gate-results.json
Path to write the structured JSON results file (relative to workspace). The file contains the complete quality gate evaluation data in machine-readable format.
Outputs
Section titled “Outputs”quality-gate-status
Section titled “quality-gate-status”Type: string
Values: pass, fail, unknown
Overall gate status.
quality-gate-mode
Section titled “quality-gate-mode”Type: string
Gate mode used.
quality-gate-failing-metrics
Section titled “quality-gate-failing-metrics”Type: string
Comma-separated list of failing metric names.
quality-gate-comment-url
Section titled “quality-gate-comment-url”Type: string
URL of the PR comment (if created).
metrics-collected
Section titled “metrics-collected”Type: number
Number of metrics collected from PR.
baseline-builds-considered
Section titled “baseline-builds-considered”Type: number
Number of baseline builds used for comparison.
baseline-reference-branch
Section titled “baseline-reference-branch”Type: string
Reference branch used for baseline.
quality-gate-results-path
Section titled “quality-gate-results-path”Type: string
Absolute path to the written JSON results file.
quality-gate-results-json
Section titled “quality-gate-results-json”Type: string
Full quality gate result as a JSON string. Usable with fromJSON() in workflow expressions.
Examples
Section titled “Examples”Basic Quality Gate
Section titled “Basic Quality Gate”Hard Mode with Artifact Storage
Section titled “Hard Mode with Artifact Storage”Consuming JSON Results
Section titled “Consuming JSON Results”Use structured output in downstream steps or external tools:
Required Permissions
Section titled “Required Permissions”For Artifact Storage
Section titled “For Artifact Storage”Both actions need:
Quality gate also needs:
For S3 Storage
Section titled “For S3 Storage”Quality gate also needs:
S3 access is controlled via credentials, not GitHub permissions.
Complete Workflow Example
Section titled “Complete Workflow Example”Main branch + PR workflows together:
Security Notes
Section titled “Security Notes”- All S3 credentials must come from GitHub Secrets
- Credentials are never logged or exposed in error messages
GITHUB_TOKENis auto-detected for artifact operations- PR comments contain only metric values, no sensitive data
Related Resources
Section titled “Related Resources”- Storage Guide - Storage configuration
- Quality Gates Guide - Threshold setup
- Configuration Reference - Config file options