Skip to content

ast-grep/action

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

Repository files navigation

ast-grep/action

A GitHub Action to run ast-grep linting!

image

See a more detailed setup guide in ast-grep's tooling guide.

Inputs

version

Optional The version of ast-grep to use in the action. Default is latest.

config

Optional The file path to ast-grep's project config relative to root dir. Default is sgconfig.yml.

Example usage

Basic

on: [push]

jobs:
  sg-lint:
    runs-on: ubuntu-latest
    name: Run ast-grep lint
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: ast-grep lint step
        uses: ast-grep/action@latest

Advanced

on: [push]

jobs:
  sg-lint:
    runs-on: ubuntu-latest
    name: Run ast-grep lint
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: ast-grep lint step
        uses: ast-grep/action@latest
        with:
          version: 0.17.1
          config: sgconfig.yml