From c4b0a3e3653b1220cd8585c32717f5f1bd964d54 Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Wed, 30 Oct 2024 16:38:09 +0100 Subject: [PATCH] ci(sqlgen): check on PR --- .github/workflows/check-on-pr-sqlgen.yml | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/check-on-pr-sqlgen.yml diff --git a/.github/workflows/check-on-pr-sqlgen.yml b/.github/workflows/check-on-pr-sqlgen.yml new file mode 100644 index 0000000..57c6d79 --- /dev/null +++ b/.github/workflows/check-on-pr-sqlgen.yml @@ -0,0 +1,30 @@ +name: Lint rolldebee/sqlgen + +on: + pull_request: + branches: + - main + paths: + - "sqlgen/**/*.kt" + - "sqlgen/**/*.kts" + - "!sqlgen/README.md" + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.4.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/ + - name: Lint using ktlint + run: | + ktlint --reporter=checkstyle,output=build/ktlint-report.xml "sqlgen/**/*.kt" + continue-on-error: true + - uses: yutailang0119/action-ktlint@v4 + with: + report-path: build/*.xml # Support glob patterns by https://www.npmjs.com/package/@actions/glob + continue-on-error: false # If annotations contain error of severity, action-ktlint exit 1. + permissions: + contents: read + pull-requests: read + checks: write