https://github.com/eighty4/model-t
Validating workflows for GitHub Actions
https://github.com/eighty4/model-t
github-actions
Last synced: 5 months ago
JSON representation
Validating workflows for GitHub Actions
- Host: GitHub
- URL: https://github.com/eighty4/model-t
- Owner: eighty4
- License: bsd-2-clause
- Created: 2025-05-20T20:01:41.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-12T20:07:39.000Z (6 months ago)
- Last Synced: 2026-01-13T01:18:53.655Z (6 months ago)
- Topics: github-actions
- Language: TypeScript
- Homepage:
- Size: 80.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# model-t
> "Make the best quality goods possible"
>
> - Henry Ford'
The npm package `@eighty4/model-t` ships a CLI and APIs for validating GitHub
Actions workflows. Workflows are validated for schema and runtime behavior and
can be easily integrated into git hooks for immediate feedback.
## Validating workflows
```bash
# install with npm
npm i -g @eighty4/model-t
model-t -h
# validate a workflow
model-t .github/workflows/publish.yml
# validate all workflows in .github/workflows
model-t .
```
## Using with git hooks
### Validating on `git push`
Use this script as your push hook by writing it to `.git/hooks/pre-push`. Any
pushes with changes to your GitHub Workflows will run `model-t .` to validate
your updates.
```bash
#!/bin/sh
set -e
read -a _input
_changes=$(git diff --name-only ${_input[1]} ${_input[3]})
if echo "$_changes" | grep -Eq "^\.github/workflows/.*?\.ya?ml$"; then
model-t .
fi
```
### Validating on `git commit`
This script at `.git/hooks/pre-commit` will check the output of `git status`
for changes to GitHub Workflows and run `model-t .` to validate your updates.
```bash
#!/bin/sh
set -e
_changes=$(git status)
if echo "$_changes" | grep -Eq "\.github/workflows/.*?\.ya?ml"; then
model-t .
fi
```