From 00ee6c88c3f1ff67f099c03aa6b31ed535fe5c39 Mon Sep 17 00:00:00 2001 From: Yaroslav Bondarenko Date: Fri, 26 Apr 2024 11:06:52 +0300 Subject: [PATCH] [DO-110] fixed Gitea Action workflow file (#22) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Создан конфиг для Groovy линтера и workflow для Gitea action чтобы запускать этот линтер. Reviewed-on: https://git.avroid.tech/DevOps/jenkins-shared-lib/pulls/22 --- .gitea/workflows/groovy-linter.yml | 15 +++++++++++---- .groovylintrc.json | 1 - 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/groovy-linter.yml b/.gitea/workflows/groovy-linter.yml index a9a484e..0af84dc 100644 --- a/.gitea/workflows/groovy-linter.yml +++ b/.gitea/workflows/groovy-linter.yml @@ -18,8 +18,8 @@ jobs: container: image: harbor.avroid.tech/devops/npm-groovy-lint:14.4.1-0 steps: - - run: echo "Start job on ${{ runner.name }} with os ${{ runner.os }}" - - run: echo "Work with branch ${{ gitea.ref }} repository ${{ gitea.repository }}" + - run: echo "Start job on ${{ runner.name }} with OS ${{ runner.os }}" + - run: echo "Work with branch ${{ gitea.ref }} in repository ${{ gitea.repository }}" - name: Check out repository code uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Mirrors/github-actions-checkout.git@v4 with: @@ -31,9 +31,16 @@ jobs: with: files: | **/*.groovy - - name: Run step if any of the listed files above change + **/Jenkinsfile + - name: Run step if there is no changed files + id: no_files_to_check + if: steps.changed-files-specific.outputs.any_changed != 'true' + run: echo "*** No changed groovy files, nothing to check. ***" + + - name: Run linter for changed files id: groovy_linter - uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/npm-groovy-lint-docker-action.git@v7 + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/npm-groovy-lint-docker-action.git@v17 with: input_flags: "--failon error" input_files: ${{ steps.changed-files-specific.outputs.all_changed_files }} diff --git a/.groovylintrc.json b/.groovylintrc.json index b562b92..aaa0461 100644 --- a/.groovylintrc.json +++ b/.groovylintrc.json @@ -9,7 +9,6 @@ "ignoreVariableNames": "_" }, "naming.FactoryMethodName": "off", - "naming.PropertyName": "off", "unnecessary.UnnecessaryGetter": "off", "size.NestedBlockDepth": { "maxNestedBlockDepth": 10