From 79a5ed0445b6fc88359f9a8bb97bc26261c6e66f Mon Sep 17 00:00:00 2001 From: cargil Date: Tue, 2 Jul 2024 18:34:57 +0100 Subject: [PATCH] ATO-828: Set up linting in CI --- .github/workflows/pre-merge-checks.yml | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/pre-merge-checks.yml diff --git a/.github/workflows/pre-merge-checks.yml b/.github/workflows/pre-merge-checks.yml new file mode 100644 index 00000000..a4c35452 --- /dev/null +++ b/.github/workflows/pre-merge-checks.yml @@ -0,0 +1,30 @@ +name: Pre-merge checks +on: + pull_request: + types: + - opened + - reopened + - ready_for_review + - synchronize + merge_group: + +jobs: + style-checks: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Get Node.js version + run: | + version=$(grep -oP -m1 'node:\K.*(?=@)' Dockerfile) + echo "NODE_VERSION=$version" >> $GITHUB_ENV + - name: Set up Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Install dependencies + run: npm install + - name: Run lint + run: npm run check:lint + - name: Run prettier + run: npm run check:pretty