From 64836313e02ad0674acd4ffa5453546398804f94 Mon Sep 17 00:00:00 2001 From: shimoncohen Date: Thu, 25 Sep 2025 13:24:28 +0300 Subject: [PATCH 1/7] ci: run lints during PR --- .github/workflows/Lint.yml | 29 ----------------------------- .github/workflows/Main.yaml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/Lint.yml diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml deleted file mode 100644 index ffc12ef21..000000000 --- a/.github/workflows/Lint.yml +++ /dev/null @@ -1,29 +0,0 @@ -# name: Lint - -# on: [pull_request] - -# jobs: -# eslint: -# name: Run eslint -# runs-on: ubuntu-latest - -# steps: -# - name: Check out Git repository -# uses: actions/checkout@v2 - -# - name: Set up Node.js -# uses: actions/setup-node@v1 -# with: -# node-version: 12 - -# # ESLint and Prettier must be in `package.json` -# - name: Install Node.js dependencies -# run: npm install - -# - name: Run linters -# uses: samuelmeuli/lint-action@v1 -# with: -# github_token: ${{ secrets.github_token }} -# # Enable linters -# eslint: true -# eslint_extensions: ts,tsx diff --git a/.github/workflows/Main.yaml b/.github/workflows/Main.yaml index 7eb89ed50..1e1d993e8 100644 --- a/.github/workflows/Main.yaml +++ b/.github/workflows/Main.yaml @@ -2,7 +2,19 @@ name: CI on: [pull_request] +permissions: + contents: read + pull-requests: read + jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: helm-lint + uses: MapColonies/shared-workflows/actions/helm-lint@helm-lint-v1 + - name: eslint + uses: MapColonies/shared-workflows/actions/eslint@eslint-v1 + build_and_test: runs-on: ubuntu-latest strategy: From 5ba390854eb2c200b80e215d12d0a9ef40864758 Mon Sep 17 00:00:00 2001 From: shimoncohen Date: Thu, 25 Sep 2025 13:45:12 +0300 Subject: [PATCH 2/7] ci: seperate eslint and helm lint to different jobs --- .github/workflows/Main.yaml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Main.yaml b/.github/workflows/Main.yaml index 1e1d993e8..5f5188eba 100644 --- a/.github/workflows/Main.yaml +++ b/.github/workflows/Main.yaml @@ -7,13 +7,38 @@ permissions: pull-requests: read jobs: - lint: + eslint: + name: Run TS Project eslint + runs-on: ubuntu-latest + + strategy: + matrix: + node: [22.x, 24.x] + + steps: + - name: Check out TS Project Git repository + uses: actions/checkout@v5 + + - name: Init Nodejs + uses: MapColonies/shared-workflows/actions/init-npm@init-npm-v1 + with: + node-version: ${{ matrix.node }} + + - name: Run TS Project linters + uses: wearerequired/lint-action@v2 + with: + tsc: true + eslint: true + prettier: true + stylelint: true + eslint_extensions: ts + + helm-lint: + name: Run Helm lint Check runs-on: ubuntu-latest steps: - name: helm-lint uses: MapColonies/shared-workflows/actions/helm-lint@helm-lint-v1 - - name: eslint - uses: MapColonies/shared-workflows/actions/eslint@eslint-v1 build_and_test: runs-on: ubuntu-latest From fa809cb27aaebe95e5e48a8d5175d1d20ee2a3cd Mon Sep 17 00:00:00 2001 From: shimoncohen Date: Thu, 25 Sep 2025 13:56:11 +0300 Subject: [PATCH 3/7] ci: move code lint check to the build_and_test step --- .github/workflows/Main.yaml | 39 +++++++++---------------------------- 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/.github/workflows/Main.yaml b/.github/workflows/Main.yaml index 5f5188eba..57b45852c 100644 --- a/.github/workflows/Main.yaml +++ b/.github/workflows/Main.yaml @@ -7,32 +7,6 @@ permissions: pull-requests: read jobs: - eslint: - name: Run TS Project eslint - runs-on: ubuntu-latest - - strategy: - matrix: - node: [22.x, 24.x] - - steps: - - name: Check out TS Project Git repository - uses: actions/checkout@v5 - - - name: Init Nodejs - uses: MapColonies/shared-workflows/actions/init-npm@init-npm-v1 - with: - node-version: ${{ matrix.node }} - - - name: Run TS Project linters - uses: wearerequired/lint-action@v2 - with: - tsc: true - eslint: true - prettier: true - stylelint: true - eslint_extensions: ts - helm-lint: name: Run Helm lint Check runs-on: ubuntu-latest @@ -48,13 +22,13 @@ jobs: node-version: [16.13.x] steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - uses: actions/cache@v4 with: path: '**/node_modules' key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: ${{ matrix.node-version }} - name: Install yarn @@ -63,11 +37,16 @@ jobs: echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update sudo apt-get install --no-install-recommends yarn - - name: Install dependecies run: yarn - name: Lint - run: yarn run eslint:check + uses: wearerequired/lint-action@v2 + with: + tsc: true + eslint: true + prettier: true + stylelint: true + eslint_extensions: ts - name: Test run: yarn test From 6a977f6ccb58c8f2fab19ae2f3843003b61ea741 Mon Sep 17 00:00:00 2001 From: shimoncohen Date: Thu, 25 Sep 2025 14:00:07 +0300 Subject: [PATCH 4/7] ci: remove stylelint from lint check --- .github/workflows/Main.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Main.yaml b/.github/workflows/Main.yaml index 57b45852c..2c4c9c550 100644 --- a/.github/workflows/Main.yaml +++ b/.github/workflows/Main.yaml @@ -45,7 +45,6 @@ jobs: tsc: true eslint: true prettier: true - stylelint: true eslint_extensions: ts - name: Test run: yarn test From 1821ac165b8d498e027a25d4940d520300af768a Mon Sep 17 00:00:00 2001 From: shimoncohen Date: Thu, 25 Sep 2025 15:28:13 +0300 Subject: [PATCH 5/7] ci: add write permissions for lint step --- .github/workflows/Main.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/Main.yaml b/.github/workflows/Main.yaml index 2c4c9c550..3485b04d6 100644 --- a/.github/workflows/Main.yaml +++ b/.github/workflows/Main.yaml @@ -16,6 +16,9 @@ jobs: build_and_test: runs-on: ubuntu-latest + permissions: + checks: write + contents: write strategy: matrix: os: [ubuntu-latest] From 4ad1958f1618c3a4c564916bc9ae0585a25cf082 Mon Sep 17 00:00:00 2001 From: shimoncohen Date: Thu, 25 Sep 2025 15:44:22 +0300 Subject: [PATCH 6/7] ci: run linters only on code files --- .github/workflows/Main.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Main.yaml b/.github/workflows/Main.yaml index 3485b04d6..ca77de199 100644 --- a/.github/workflows/Main.yaml +++ b/.github/workflows/Main.yaml @@ -6,6 +6,9 @@ permissions: contents: read pull-requests: read +env: + CODE_DIR: src + jobs: helm-lint: name: Run Helm lint Check @@ -46,9 +49,12 @@ jobs: uses: wearerequired/lint-action@v2 with: tsc: true + tsc_dir: ${{ env.CODE_DIR }} eslint: true + eslint_dir: ${{ env.CODE_DIR }} + eslint_extensions: js,jsx,ts,tsx prettier: true - eslint_extensions: ts + prettier_dir: ${{ env.CODE_DIR }} - name: Test run: yarn test From 48a3b9f3e556084d1221e22c8374562756ad8852 Mon Sep 17 00:00:00 2001 From: shimoncohen Date: Thu, 25 Sep 2025 15:48:35 +0300 Subject: [PATCH 7/7] ci: run prettier only on files in src --- .github/workflows/Main.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/Main.yaml b/.github/workflows/Main.yaml index ca77de199..8d6528734 100644 --- a/.github/workflows/Main.yaml +++ b/.github/workflows/Main.yaml @@ -49,9 +49,7 @@ jobs: uses: wearerequired/lint-action@v2 with: tsc: true - tsc_dir: ${{ env.CODE_DIR }} eslint: true - eslint_dir: ${{ env.CODE_DIR }} eslint_extensions: js,jsx,ts,tsx prettier: true prettier_dir: ${{ env.CODE_DIR }}