Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GitHub Action for checking pull requests

License

Notifications You must be signed in to change notification settings

arghena/insight

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Insight

A GitHub Action for checking pull requests.

CI CD

Features

  • Use the insight.toml config file to customize the formatters and linters your project needs.
  • Supports using commitlint to check the pull request title.
  • Responds to on.schedule and on.push.tags events, respecting .gitignore when running linters.
  • Can check build files in dist/ using a git diff approach.
  • Lets you customize formatter and linter versions and arguments.
  • Supports glob patterns to match exactly the files you want to check.
  • Ships with minimal defaults to keep opinionated behavior to a minimum.

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.
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`.
        # The config file is fetched automatically.
        uses: actions/checkout@v6
      - name: Run Insight
        uses: arghena/[email protected]
        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 commit SHA that triggered the workflow.
          # Default: ${{ github.sha }}
          sha: ''
          # 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: ''
          # The type of ref that triggered the workflow run.
          # Default: ${{ github.ref_type }}
          ref-type: ''
          # 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.

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

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

[push]
# Formatters to run on `on.push.tags` events.
# Default: []
formatters = ["prettier"]
# Linters to run on `on.push.tags` events.
# Default: []
linters = ["check-dist", "eslint"]

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

[args.formatters]
# Arguments passed to formatters.
# Default: []
shfmt = ["-i", "4", "-ci"]

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

[versions]
# Lock formatter/linter versions.
# Default: "latest"
commitlint = "19.8.1"
prettier = "3.6.2"
eslint = "9.33.0"

Available Formatters

Tool Formatter name
prettier prettier
rustfmt cargo-fmt
shfmt shfmt
taplo taplo
tombi tombi

Available Linters

Note

  • commitlint only supports configuring [args.linters] and [versions].
  • commitlint-config-conventional only supports configuring [versions].
Tool Linter name Supports scheduling
commitlint commitlint
@commitlint/config-conventional commitlint-config-conventional
cargo-deny cargo-deny
node-audit node-audit
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
tombi tombi
tsc tsc

Contributing

Please refer to our 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.

Releases

The version naming of Insight follows Semantic Versioning 2.0.0.

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.

About

GitHub Action for checking pull requests

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •