Insight is a GitHub Action for checking pull requests.
It's designed to provide a unified config file so you can run various formatters and linters more efficiently.
- Use the
insight.toml
config file to customize the formatters and linters your project needs. - Supports using commitlint to check pull request titles.
- Responds to
on.schedule
andon.push.tags
events, respecting.gitignore
when running linters. - Can check build files in
dist/
using agit diff
approach. - Lets you customize formatter and linter versions and options.
- Supports glob patterns to match exactly the files you want to check.
- Supports detecting file changes and outputs the result.
- Ships with minimal defaults to keep opinionated behavior to a minimum.
jobs:
insight:
name: Insight
runs-on: ubuntu-latest
outputs:
any-changed: ${{ steps.insight.outputs.any-changed }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Run Insight
id: insight
uses: arghena/insight@v0.1.0-canary.13
with:
# The path to the Insight config file.
# Default: '.github/insight.toml'
config-path: ''
# The name of the event that triggered the workflow run.
# Default: ${{ github.event_name }}
event-name: ''
# The type of ref that triggered the workflow run.
# Default: ${{ github.ref_type }}
ref-type: ''
# The type of pull request event.
# Default: ${{ github.event.action }}
pull-request-type: ''
# The title of pull request event.
# Default: ${{ github.event.pull_request.title }}
pull-request-title: ''
# Personal access token (PAT) used to fetch the repository.
# Default: ${{ github.token }}
token: ''
# Repository name with owner.
# Default: ${{ github.repository }}
repository: ''
# The number of the pull request to check.
# Default: ${{ github.event.pull_request.number }}
pull-request-number: ''
detect-changes:
name: Detect Changes
needs: insight
if: ${{ needs.insight.outputs.any-changed == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Detect File Changes
run: echo 'File changes detected'
Note
You can refer to our examples.
[match]
# Match dotfiles.
# Default: false
dot = true
[pull_request]
# Check pull request title.
# Default: false
check_title = true
# Detect file changes.
# Default: []
detect_changes = ["**/*.rs"]
[schedule]
# Linters to run on `on.schedule` events.
# Default: []
tasks = ["cargo_deny"]
[push_tag]
# Formatters to run on `on.push.tags` events.
# Default: []
formatters = ["prettier"]
# Linters to run on `on.push.tags` events.
# Default: []
linters = ["check_dist", "eslint"]
[options.formatters]
# Options passed to formatters.
# Default: []
shfmt = ["-i", "4", "-ci"]
[options.linters]
# Options passed to linters.
# Default: []
check_dist = ["prepare"]
yamllint = ["--strict"]
[formatters]
# Glob patterns for files that trigger formatters.
# Default: []
prettier = ["**/*.yml", "**/*.ts", "**/*.md", "**/*.json"]
shfmt = ["etc/ci/*.sh"]
[linters]
# Glob patterns for files that trigger linters.
# Default: []
check_dist = ["src/**/*.ts", "package.json", "pnpm-lock.yaml"]
cargo_deny = ["Cargo.toml", "Cargo.lock"]
typos = ["**/*", "!dist/**"]
yamllint = ["**/*.yml"]
eslint = ["**/*.ts"]
[versions]
# Lock formatter/linter versions.
# Default: "latest"
commitlint = "19.8.1"
prettier = "3.6.2"
eslint = "9.33.0"
Tool | Formatter name |
---|---|
prettier | prettier |
rustfmt | cargo_fmt |
shfmt | shfmt |
taplo | taplo |
Tool | Linter name | Supports scheduling |
---|---|---|
check-dist | check_dist |
|
eslint | eslint |
|
typos | typos |
|
yamllint | yamllint |
|
actionlint | actionlint |
|
ast-grep | ast_grep |
|
clippy | cargo_clippy |
|
cargo-msrv | cargo_msrv |
|
cargo-tarpaulin | cargo_tarpaulin |
|
alex | alex |
|
markdownlint-cli2 | markdownlint_cli2 |
|
vale | vale |
|
shellcheck | shellcheck |
|
taplo | taplo |
|
cargo-deny | cargo_deny |
✅ |
Please refer to our CONTRIBUTING.md.
Note
If you believe you have found a security vulnerability in Insight, we encourage you to responsibly disclose this and NOT open a public issue.
Please refer to our SECURITY.md.
The version naming of Insight follows Semantic Versioning 2.0.0.
Note
When Insight releases a new major version, the previous stable version will be designated as an LTS version.
The LTS version of Insight provides security updates and bug fixes for six months.
Insight | Node.js | Codename | Released at | End of Life |
---|---|---|---|---|
v0.1.0 | v24 | Galileo | - | - |
Insight is distributed under the MIT License.