From 1ad918c92960f33529f4100b8654991110ebd1af Mon Sep 17 00:00:00 2001 From: Yaroslav Bondarenko Date: Fri, 26 Apr 2024 11:06:21 +0300 Subject: [PATCH] [DO-110] fixed Gitea Action workflow file (!24) 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-pipelines/pulls/24 Reviewed-by: Aleksandr Vodyanov --- .gitea/workflows/groovy-linter.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 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 }}