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

Folders and files

NameName
Last commit message
Last commit date
Jun 4, 2024
Jun 12, 2024
Jul 28, 2023
Jun 4, 2024
Jul 26, 2023
Jul 26, 2023
Jul 26, 2023
Jun 4, 2024
Jun 11, 2024
Jan 1, 2025
Jan 27, 2024
Jul 28, 2023
Jul 28, 2023
Jul 28, 2023

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.

paths

Optional File paths string, corresponding to PATHS passed to the ast-grep cli, to limit the paths the action runs on. Multiple file paths can be delimited by whitespaces.

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
          paths: src lib