From 033287d0b72394e42ebaec2cba57fccfdc98495f Mon Sep 17 00:00:00 2001 From: Robin van der Vleuten Date: Tue, 1 Aug 2023 11:04:46 +0200 Subject: [PATCH] chore: Error when grammar.peg contains uncommitted changes (#4) * Error when grammar.peg contains uncommitted changes * Make check part of lint workflow * Correctly set exit code when erroring --- .github/workflows/lint.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4c49cb9..422dfab 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,4 +6,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + - run: go install github.com/pointlander/peg@v1.0 + - run: go generate + - uses: tj-actions/verify-changed-files@v16 + id: verify-unchanged-grammar + with: + files: | + grammar.peg.go + - if: steps.verify-unchanged-grammar.outputs.files_changed == 'true' + run: echo "::error file=grammar.peg.go::Make sure you regenerate grammar.peg when making any changes" && exit 1 - uses: golangci/golangci-lint-action@v3