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

https://github.com/arghena/insight

GitHub Action for checking pull requests
https://github.com/arghena/insight

actions ci code-quality hacktoberfest linter

Last synced: 3 months ago
JSON representation

GitHub Action for checking pull requests

Awesome Lists containing this project

README

          


Insight


A GitHub Action for checking pull requests.

CI
Release
License

## Features

- **Blazing Fast:** Runs formatters and linters concurrently to speed up your CI workflows.
- **Highly Customizable:** Use a single `insight.toml` file to define exactly what your project needs, including tool versions and CLI arguments.
- **Precise Targeting:** Supports [glob]() patterns to match exactly the files you want to check.
- **Rich Job Summaries:** Automatically generates comprehensive GitHub Actions job summaries complete with error tables and collapsible logs.
- **GitHub Native:** Seamlessly validates PR titles via [commitlint](https://commitlint.js.org) and supports [`on.schedule`](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onschedule) events.
- **Unopinionated:** Ships with minimal defaults, keeping opinionated behavior to an absolute minimum so you remain in control.

## Usage

> [!IMPORTANT]
>
> - If you set `check-pull-request-title` to `true`, then Insight will only check the pull request title.
> - Insight only checks `added` and `modified` files.

```yaml
jobs:
insight:
name: Insight
runs-on: ubuntu-latest
steps:
- name: Checkout repository
# If `check-pull-request-title` is set to `true`,
# it's recommended to remove `actions/checkout`.
uses: actions/checkout@v6
- name: Run Insight
uses: arghena/insight@v0.1.0-canary.52
with:
# The path to the Insight config file.
# Default: '.github/insight.toml'
config-path: ''
# Use `commitlint` to check the pull request title.
# Default: 'false'
check-pull-request-title: ''
# The title of pull request event.
# Default: ${{ github.event.pull_request.title }}
pull-request-title: ''
# The name of the event that triggered the workflow run.
# Default: ${{ github.event_name }}
event-name: ''
# 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: ''
```

## Configure Insight

> [!NOTE]
> You can refer to our [examples](https://github.com/arghena/insight/tree/canary/examples).

```toml
[match]
# Match dotfiles.
# Default: false
dot = true

[schedule]
# Linters to run on `on.schedule` events.
# Default: []
linters = ["cargo-deny"]

[formatters]
# Glob patterns for files that trigger formatters.
# Default: []
prettier = ["**/*.ts"]
cargo-fmt = ["**/*.rs"]

[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/**"]

[args.formatters]
# Arguments passed to formatters.
# Default: []
cargo-fmt = ["--all"]

[args.linters]
# Arguments passed to linters.
# Default: []
check-dist = ["prepare"]

[versions]
# Lock formatter/linter versions.
# Default: "latest"
prettier = "3.6.2"
```

## Available Formatters

| Tool | Formatter name | Accepts File Paths |
| ------------------------------------------------ | -------------- | :----------------: |
| [rustfmt](https://github.com/rust-lang/rustfmt) | `cargo-fmt` | |
| [prettier](https://github.com/prettier/prettier) | `prettier` | ✅ |
| [shfmt](https://github.com/mvdan/sh) | `shfmt` | ✅ |
| [tombi](https://github.com/tombi-toml/tombi) | `tombi` | ✅ |

## Available Linters

| Tool | Linter name | Accepts File Paths | Supports scheduling |
| ---------------------------------------------------------------------------------------- | ------------------- | :----------------: | :-----------------: |
| [actionlint](https://github.com/rhysd/actionlint) | `actionlint` | ✅ | |
| [alex](https://github.com/get-alex/alex) | `alex` | ✅ | |
| [ast-grep](https://github.com/ast-grep/ast-grep) | `ast-grep` | ✅ | |
| [clippy](https://github.com/rust-lang/rust-clippy) | `cargo-clippy` | | |
| [cargo-deny](https://github.com/EmbarkStudios/cargo-deny) | `cargo-deny` | | ✅ |
| [cargo-msrv](https://github.com/foresterre/cargo-msrv) | `cargo-msrv` | | |
| [check-dist](https://github.com/arghena/insight/blob/canary/src/linters/check-dist.ts) | `check-dist` | | |
| [eslint](https://github.com/eslint/eslint) | `eslint` | ✅ | |
| [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) | `markdownlint-cli2` | ✅ | |
| [node-audit](https://github.com/arghena/insight/blob/canary/src/linters/node-audit.ts) | `node-audit` | | ✅ |
| [node-dedupe](https://github.com/arghena/insight/blob/canary/src/linters/node-dedupe.ts) | `node-dedupe` | | |
| [shellcheck](https://github.com/koalaman/shellcheck) | `shellcheck` | ✅ | |
| [tombi](https://github.com/tombi-toml/tombi) | `tombi` | ✅ | |
| [trivy](https://github.com/aquasecurity/trivy) | `trivy` | | |
| [tsc](https://github.com/microsoft/TypeScript) | `tsc` | | |
| [typos](https://github.com/crate-ci/typos) | `typos` | ✅ | |
| [vale](https://github.com/errata-ai/vale) | `vale` | ✅ | |
| [yamllint](https://github.com/adrienverge/yamllint) | `yamllint` | ✅ | |

## Contributing

Please refer to our [CONTRIBUTING.md](https://github.com/arghena/insight/blob/canary/.github/CONTRIBUTING.md).

## Security

> [!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](https://github.com/arghena/insight/blob/canary/.github/SECURITY.md).

## Releases

The version naming of Insight follows [Semantic Versioning 2.0.0](https://semver.org/#semantic-versioning-200).

### Long-Term Support

> [!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.

### Release Table

| Insight | Node.js | Codename | Released at | End of Life |
| ------- | ------- | -------- | ----------- | ----------- |
| v0.1.0 | v24 | Galileo | - | - |

## License

Insight is distributed under the [MIT License](https://github.com/arghena/insight/blob/canary/LICENSE).