diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 113054b..93c164f 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -1,4 +1,4 @@ -# Copyright Avroid, Ltd. 2023-2024 +# Copyright AVROID, Ltd., 2024 # # You can not use the contents of the file in any way without # AVROID, Ltd. written permission. @@ -23,7 +23,34 @@ jobs: - name: Check out repository code uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Mirrors/github-actions-checkout.git@v4 with: - fetch-depth: 0 # for work tj-actions/changed-files - persist-credentials: false # for work tj-actions/changed-files - - name: Check license - uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@v1 + fetch-depth: 0 + persist-credentials: false + - name: Get all files that have changed + id: changed-files-specific + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Mirrors/github-actions-tj-actions-changed-files.git@v44 + with: + files: | + **/*.c + **/*.cpp + **/*.h + **/*.hpp + **/*.sh + **/*.cmake + **/CMakeLists.txt + **/Jenkinsfile + **/.yaml + **/.yml + **/Dockerfile + - 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: Check license for changed files + id: check_license + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@v1.13 + with: + input_files: ${{ steps.changed-files-specific.outputs.all_changed_files }} + exclude_pattern: + diff --git a/Dockerfile b/Dockerfile index f817806..d24c7bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright Avroid, Ltd. 2024 +# Copyright (c) AVROID, Ltd., 2024 # # You can not use the contents of the file in any way without # AVROID, Ltd. written permission. diff --git a/action.yml b/action.yml index 69fe4bc..66b02fd 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -# Copyright Avroid, Ltd. 2023-2024 +# Copyright AVROID, Ltd., 2024 # # You can not use the contents of the file in any way without # AVROID, Ltd. written permission. diff --git a/entrypoint.sh b/entrypoint.sh index 25ff61a..da2b1f0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright Avroid, Ltd. 2023-2024 +# Copyright (c) AVROID, Ltd., 2024 # # You can not use the contents of the file in any way without # AVROID, Ltd. written permission. @@ -11,4 +11,6 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files with absent license:" echo "===================================" -echo /app/addlicense -check "$1" . | sh +for file in $INPUT_INPUT_FILES; do + echo /app/addlicense -check "$1" $file | sh +done