From 180d10f81d9470f42fd959926447f894312779f3 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 12:34:18 +0300 Subject: [PATCH 01/36] add files for new action --- .gitea/workflows/Dockerfile | 5 +++++ .gitea/workflows/action.yml | 8 ++++++++ .gitea/workflows/check-license.yml | 22 ++++++++++++++++++++++ .gitea/workflows/entrypoint.sh | 5 +++++ 4 files changed, 40 insertions(+) create mode 100644 .gitea/workflows/Dockerfile create mode 100644 .gitea/workflows/action.yml create mode 100644 .gitea/workflows/check-license.yml create mode 100644 .gitea/workflows/entrypoint.sh diff --git a/.gitea/workflows/Dockerfile b/.gitea/workflows/Dockerfile new file mode 100644 index 0000000..e6f455c --- /dev/null +++ b/.gitea/workflows/Dockerfile @@ -0,0 +1,5 @@ +FROM harbor.avroid.tech/devops/addlicense:1.1.1 + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml new file mode 100644 index 0000000..130eabd --- /dev/null +++ b/.gitea/workflows/action.yml @@ -0,0 +1,8 @@ +name: 'Addlicense action' +description: 'Checks license and notify about missing license headers' +inputs: +outputs: +runs: + using: 'docker' + image: 'Dockerfile' + args: [] diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml new file mode 100644 index 0000000..2055d84 --- /dev/null +++ b/.gitea/workflows/check-license.yml @@ -0,0 +1,22 @@ +--- +name: Check license +run-name: ${{ gitea.actor }} is start check sources +on: [push] +# on: [pull_request] + +jobs: + scan-secrets: + name: Check license + runs-on: docker + container: + image: harbor.avroid.tech/docker-hub-proxy/node:20-alpine3.19 + steps: + - run: echo "Start job on ${{ runner.name }} with os ${{ runner.os }}" + - run: echo "Work with branch ${{ gitea.ref }} repository ${{ gitea.repository }}" + - 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: Scan for secrets + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/gitleaks-docker-action.git@v1 diff --git a/.gitea/workflows/entrypoint.sh b/.gitea/workflows/entrypoint.sh new file mode 100644 index 0000000..0c23ab2 --- /dev/null +++ b/.gitea/workflows/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +echo "Processing event '$GITHUB_EVENT_NAME'" + +addlicense -check . From b8e763f19d821449645bd4ffd15446c74687fba1 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 12:37:01 +0300 Subject: [PATCH 02/36] update readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7c84065..bd62ad8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # addlicense-docker-action +Action для проверки лицензии в файлах + +[Ссылка на проект](https://git.avroid.tech/Tools/Addlicense) From 097902e56f1f10a9870fa66710f7a88cfaa7fd0e Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 12:39:26 +0300 Subject: [PATCH 03/36] change action --- .gitea/workflows/check-license.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 2055d84..3fb5c5c 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -18,5 +18,5 @@ jobs: with: fetch-depth: 0 # for work tj-actions/changed-files persist-credentials: false # for work tj-actions/changed-files - - name: Scan for secrets - uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/gitleaks-docker-action.git@v1 + - name: Check license + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@v1 From 9c0ddf470f34e0464fe6c9d1bdad6b604aa2491e Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 12:42:23 +0300 Subject: [PATCH 04/36] remove version --- .gitea/workflows/check-license.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 3fb5c5c..083d61b 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -19,4 +19,4 @@ jobs: 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 + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git From fe8cfeeb96e954105265a54cde361455d9749004 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 12:45:35 +0300 Subject: [PATCH 05/36] test without check action --- .gitea/workflows/check-license.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 083d61b..ba1011c 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -18,5 +18,5 @@ jobs: 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 + # - name: Check license + # uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git From 97bdc9092be0a8003088b4bf368666b731c0656d Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 12:58:33 +0300 Subject: [PATCH 06/36] up version checkout --- .gitea/workflows/check-license.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index ba1011c..9f1b980 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -14,7 +14,7 @@ jobs: - run: echo "Start job on ${{ runner.name }} with os ${{ runner.os }}" - run: echo "Work with branch ${{ gitea.ref }} repository ${{ gitea.repository }}" - name: Check out repository code - uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Mirrors/github-actions-checkout.git@v4 + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Mirrors/github-actions-checkout.git@v4.1.2 with: fetch-depth: 0 # for work tj-actions/changed-files persist-credentials: false # for work tj-actions/changed-files From d79930d1b903121965e8112b25052d1917c98f42 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 13:01:24 +0300 Subject: [PATCH 07/36] change base image in action --- .gitea/workflows/check-license.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 9f1b980..4968bdd 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -9,12 +9,13 @@ jobs: name: Check license runs-on: docker container: - image: harbor.avroid.tech/docker-hub-proxy/node:20-alpine3.19 + image: harbor.avroid.tech/devops/clang-format:14-node20 + # image: harbor.avroid.tech/docker-hub-proxy/node:20-alpine3.19 steps: - run: echo "Start job on ${{ runner.name }} with os ${{ runner.os }}" - run: echo "Work with branch ${{ gitea.ref }} repository ${{ gitea.repository }}" - name: Check out repository code - uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Mirrors/github-actions-checkout.git@v4.1.2 + 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 From 7265c910c87801169160f6e25ecf1deb96987434 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 13:02:08 +0300 Subject: [PATCH 08/36] add step with cheking license --- .gitea/workflows/check-license.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 4968bdd..8e909f9 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -19,5 +19,5 @@ jobs: 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 + - name: Check license + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git From e8a740c31c6d30d1b10bda89b15daf4cc6817609 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 13:02:52 +0300 Subject: [PATCH 09/36] add latest for addlicense checker --- .gitea/workflows/check-license.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 8e909f9..be35b60 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -20,4 +20,4 @@ jobs: 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 + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@latest From 619b8535f1c3e546a27b0f2876b55502e5809082 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 13:42:07 +0300 Subject: [PATCH 10/36] move files to correct place --- .gitea/workflows/check-license.yml | 7 +++---- .gitea/workflows/Dockerfile => Dockerfile | 0 .gitea/workflows/action.yml => action.yml | 0 .gitea/workflows/entrypoint.sh => entrypoint.sh | 0 4 files changed, 3 insertions(+), 4 deletions(-) rename .gitea/workflows/Dockerfile => Dockerfile (100%) rename .gitea/workflows/action.yml => action.yml (100%) rename .gitea/workflows/entrypoint.sh => entrypoint.sh (100%) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index be35b60..942b1ed 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -9,8 +9,7 @@ jobs: name: Check license runs-on: docker container: - image: harbor.avroid.tech/devops/clang-format:14-node20 - # image: harbor.avroid.tech/docker-hub-proxy/node:20-alpine3.19 + image: harbor.avroid.tech/devops/node:20-alpine3.19-0 steps: - run: echo "Start job on ${{ runner.name }} with os ${{ runner.os }}" - run: echo "Work with branch ${{ gitea.ref }} repository ${{ gitea.repository }}" @@ -19,5 +18,5 @@ jobs: 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@latest + # - name: Check license + # uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@latest diff --git a/.gitea/workflows/Dockerfile b/Dockerfile similarity index 100% rename from .gitea/workflows/Dockerfile rename to Dockerfile diff --git a/.gitea/workflows/action.yml b/action.yml similarity index 100% rename from .gitea/workflows/action.yml rename to action.yml diff --git a/.gitea/workflows/entrypoint.sh b/entrypoint.sh similarity index 100% rename from .gitea/workflows/entrypoint.sh rename to entrypoint.sh From 3ac35005b4c5724a847791fc0c1ab1ac7d7b4de1 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 14:45:26 +0300 Subject: [PATCH 11/36] add version for checker --- .gitea/workflows/check-license.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 942b1ed..329b8a2 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -18,5 +18,5 @@ jobs: 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@latest + - name: Check license + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@v1 From 0ff51ffd0ac5c106fa488334da0d7176354e861e Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 14:47:00 +0300 Subject: [PATCH 12/36] add execute flag --- entrypoint.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755 From 0bd8b145da2b03defd0498b569713acfe0317a7a Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 14:52:58 +0300 Subject: [PATCH 13/36] change entrypoint --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e6f455c..b424715 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM harbor.avroid.tech/devops/addlicense:1.1.1 -COPY entrypoint.sh /entrypoint.sh +# COPY entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] +CMD ["addlicense", "-check", "."] From b725edda99258fc4e6983b641a6703e3804f376b Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 15:27:05 +0300 Subject: [PATCH 14/36] add entrypoint --- Dockerfile | 4 ++-- entrypoint.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b424715..e6f455c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM harbor.avroid.tech/devops/addlicense:1.1.1 -# COPY entrypoint.sh /entrypoint.sh +COPY entrypoint.sh /entrypoint.sh -CMD ["addlicense", "-check", "."] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 0c23ab2..710c956 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,4 +2,4 @@ echo "Processing event '$GITHUB_EVENT_NAME'" -addlicense -check . +/app/addlicense -check . From 5c88972380b869d78a93cf452de2c313ba9ef515 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 16:02:53 +0300 Subject: [PATCH 15/36] add warning message --- entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 710c956..017122b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,9 @@ #!/bin/sh echo "Processing event '$GITHUB_EVENT_NAME'" +echo "List of files no has license:" +echo "Start" /app/addlicense -check . + +echo "End" From 855449fc8230ba86e436a26b1b36f42b1c83cf74 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 16:07:03 +0300 Subject: [PATCH 16/36] fix --- entrypoint.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 017122b..4f745c6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,8 +2,6 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" -echo "Start" - +echo "===================================" /app/addlicense -check . -echo "End" From eb8ea872b2bb652a98e3aa00df2134f6fbad29b7 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 16:11:14 +0300 Subject: [PATCH 17/36] add license --- .gitea/workflows/check-license.yml | 8 ++++++++ Dockerfile | 8 ++++++++ action.yml | 8 ++++++++ entrypoint.sh | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 329b8a2..db3aa6b 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -1,3 +1,11 @@ +# Copyright Avroid, Ltd. 2023-2024 +# +# You can not use the contents of the file in any way without +# AVROID, Ltd. written permission. +# +# To obtain such a permit, you should contact AVROID, Ltd. +# at https://avroid.ru + --- name: Check license run-name: ${{ gitea.actor }} is start check sources diff --git a/Dockerfile b/Dockerfile index e6f455c..8854f46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,11 @@ +# Copyright Avroid, Ltd. 2023-2024 +# +# You can not use the contents of the file in any way without +# AVROID, Ltd. written permission. +# +# To obtain such a permit, you should contact AVROID, Ltd. +# at https://avroid.ru + FROM harbor.avroid.tech/devops/addlicense:1.1.1 COPY entrypoint.sh /entrypoint.sh diff --git a/action.yml b/action.yml index 130eabd..0759f35 100644 --- a/action.yml +++ b/action.yml @@ -1,3 +1,11 @@ +# Copyright Avroid, Ltd. 2023-2024 +# +# You can not use the contents of the file in any way without +# AVROID, Ltd. written permission. +# +# To obtain such a permit, you should contact AVROID, Ltd. +# at https://avroid.ru + name: 'Addlicense action' description: 'Checks license and notify about missing license headers' inputs: diff --git a/entrypoint.sh b/entrypoint.sh index 4f745c6..7398ec0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,12 @@ #!/bin/sh +# Copyright Avroid, Ltd. 2023-2024 +# +# You can not use the contents of the file in any way without +# AVROID, Ltd. written permission. +# +# To obtain such a permit, you should contact AVROID, Ltd. +# at https://avroid.ru + echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" From c75fae3aed50aef15c28800ba54a653273d08d72 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 16:18:40 +0300 Subject: [PATCH 18/36] add example --- .gitea/workflows/check-license.yml | 3 +-- README.md | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index db3aa6b..113054b 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -9,8 +9,7 @@ --- name: Check license run-name: ${{ gitea.actor }} is start check sources -on: [push] -# on: [pull_request] +on: [pull_request] jobs: scan-secrets: diff --git a/README.md b/README.md index bd62ad8..d39daf3 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,29 @@ Action для проверки лицензии в файлах [Ссылка на проект](https://git.avroid.tech/Tools/Addlicense) + +Пример использования + +```yaml +--- +name: Check license +run-name: ${{ gitea.actor }} is start check sources +on: [pull_request] + +jobs: + scan-secrets: + name: Check license + runs-on: docker + container: + image: harbor.avroid.tech/devops/node:20-alpine3.19-0 + steps: + - run: echo "Start job on ${{ runner.name }} with os ${{ runner.os }}" + - run: echo "Work with branch ${{ gitea.ref }} repository ${{ gitea.repository }}" + - 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 +``` From 706826d3c6ecf01ef692891a9b87cd8e62ec2bbd Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 19:19:29 +0300 Subject: [PATCH 19/36] test exclude param --- action.yml | 3 +++ entrypoint.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 0759f35..0a9cb2b 100644 --- a/action.yml +++ b/action.yml @@ -9,6 +9,9 @@ name: 'Addlicense action' description: 'Checks license and notify about missing license headers' inputs: + exclude_config: + description: 'Config that contains exclude files' + required: false outputs: runs: using: 'docker' diff --git a/entrypoint.sh b/entrypoint.sh index 7398ec0..0c697bf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,4 +12,4 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" echo "===================================" /app/addlicense -check . - +echo "${EXCLUDE_CONFIG}" From 741924c442bf1b68cdf990af07d10ea5e3992b61 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Thu, 11 Apr 2024 19:22:59 +0300 Subject: [PATCH 20/36] add param --- .gitea/workflows/check-license.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 113054b..64c5c40 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -27,3 +27,5 @@ jobs: 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 + with: + exclude_config: exclude.txt From eb8089cde678e92b7c18b4b3087d6e854a9ebe99 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 10:05:27 +0300 Subject: [PATCH 21/36] test args --- action.yml | 3 ++- entrypoint.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 0a9cb2b..3e72ecc 100644 --- a/action.yml +++ b/action.yml @@ -16,4 +16,5 @@ outputs: runs: using: 'docker' image: 'Dockerfile' - args: [] + args: + - ${{ inputs.exclude_config }} diff --git a/entrypoint.sh b/entrypoint.sh index 0c697bf..831899e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,4 +12,4 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" echo "===================================" /app/addlicense -check . -echo "${EXCLUDE_CONFIG}" +echo "$1" From 195a8530638a838de342d7400e628912e1eeda18 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 10:06:43 +0300 Subject: [PATCH 22/36] change branch --- .gitea/workflows/check-license.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 64c5c40..c831750 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -26,6 +26,6 @@ jobs: 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 + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@feature/DO-169/start_project with: exclude_config: exclude.txt From cabbb1d6a0e941d6407d1d17e3930f2b8c12c4f9 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:23:09 +0300 Subject: [PATCH 23/36] refactoring some param --- .gitea/workflows/check-license.yml | 2 +- action.yml | 6 +++--- entrypoint.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index c831750..8ed0bee 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -28,4 +28,4 @@ jobs: - name: Check license uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@feature/DO-169/start_project with: - exclude_config: exclude.txt + exclude_pattern: "-ignore **/**.go -ignore **/**/**.ts" diff --git a/action.yml b/action.yml index 3e72ecc..69fe4bc 100644 --- a/action.yml +++ b/action.yml @@ -9,12 +9,12 @@ name: 'Addlicense action' description: 'Checks license and notify about missing license headers' inputs: - exclude_config: - description: 'Config that contains exclude files' + exclude_pattern: + description: 'Pattern for exclude files' required: false outputs: runs: using: 'docker' image: 'Dockerfile' args: - - ${{ inputs.exclude_config }} + - ${{ inputs.exclude_pattern }} diff --git a/entrypoint.sh b/entrypoint.sh index 831899e..e261316 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,5 +11,5 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" echo "===================================" -/app/addlicense -check . -echo "$1" +/app/addlicense -check "$1" . + From 35c352394fa4083059ce4a503b64c28d6cb412a8 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:27:38 +0300 Subject: [PATCH 24/36] add quotes --- .gitea/workflows/check-license.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 8ed0bee..61dfea7 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -28,4 +28,4 @@ jobs: - name: Check license uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@feature/DO-169/start_project with: - exclude_pattern: "-ignore **/**.go -ignore **/**/**.ts" + exclude_pattern: -ignore "**/**.go" -ignore "**/**/**.ts" From e9e75e45674cf531c50fa50afb56ed4f971c4886 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:34:21 +0300 Subject: [PATCH 25/36] test --- .gitea/workflows/check-license.yml | 2 +- entrypoint.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 61dfea7..2b3151e 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -28,4 +28,4 @@ jobs: - name: Check license uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@feature/DO-169/start_project with: - exclude_pattern: -ignore "**/**.go" -ignore "**/**/**.ts" + exclude_pattern: '-ignore "**/**.go" -ignore "**/**/**.ts"' diff --git a/entrypoint.sh b/entrypoint.sh index e261316..8bbc878 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,4 +12,3 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" echo "===================================" /app/addlicense -check "$1" . - From 607a6cca85ae7fe57e4db55e4c42a69febf7ab96 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:36:27 +0300 Subject: [PATCH 26/36] test --- entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoint.sh b/entrypoint.sh index 8bbc878..a5d4005 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,4 +11,5 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" echo "===================================" +echo \"/app/addlicense -check "$1" . \" /app/addlicense -check "$1" . From d052a20133ab805ad6f5722910e1760721a8bd1f Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:38:03 +0300 Subject: [PATCH 27/36] test --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index a5d4005..56efbd6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,5 +11,5 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" echo "===================================" -echo \"/app/addlicense -check "$1" . \" +echo /app/addlicense -check "$1" . /app/addlicense -check "$1" . From 16b14261c859608bac71bd1936642b9fa486cdc5 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:48:02 +0300 Subject: [PATCH 28/36] fix --- entrypoint.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 56efbd6..409a13a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,5 +11,4 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" echo "===================================" -echo /app/addlicense -check "$1" . -/app/addlicense -check "$1" . +echo /app/addlicense -check "$1" . | bash From 256052bbe9be4ae2b1d688b92a18b438b82c76f0 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:51:27 +0300 Subject: [PATCH 29/36] replace bash to sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 409a13a..5787d7e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,4 +11,4 @@ echo "Processing event '$GITHUB_EVENT_NAME'" echo "List of files no has license:" echo "===================================" -echo /app/addlicense -check "$1" . | bash +echo /app/addlicense -check "$1" . | sh From 1255aa5ae9c1709246cb0b7736e03ec374893575 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:53:08 +0300 Subject: [PATCH 30/36] remove quotes --- .gitea/workflows/check-license.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 2b3151e..61dfea7 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -28,4 +28,4 @@ jobs: - name: Check license uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@feature/DO-169/start_project with: - exclude_pattern: '-ignore "**/**.go" -ignore "**/**/**.ts"' + exclude_pattern: -ignore "**/**.go" -ignore "**/**/**.ts" From 5f55944bd9dc431934ce1b697a51f9eff93d4ac7 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:54:13 +0300 Subject: [PATCH 31/36] test pattern --- .gitea/workflows/check-license.yml | 4 ++-- foo.cpp | 0 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 foo.cpp diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 61dfea7..5ac4de6 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -27,5 +27,5 @@ jobs: 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@feature/DO-169/start_project - with: - exclude_pattern: -ignore "**/**.go" -ignore "**/**/**.ts" + # with: + # exclude_pattern: -ignore "**/**.go" -ignore "**/**/**.ts" diff --git a/foo.cpp b/foo.cpp new file mode 100644 index 0000000..e69de29 From 580e7d4a7abe8d47d4d75a45459e4ada2404a1af Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 11:55:01 +0300 Subject: [PATCH 32/36] test --- .gitea/workflows/check-license.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index 5ac4de6..b81e017 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -27,5 +27,5 @@ jobs: 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@feature/DO-169/start_project - # with: - # exclude_pattern: -ignore "**/**.go" -ignore "**/**/**.ts" + with: + exclude_pattern: -ignore "foo.cpp" From 2979521ce572e7995ec1c36f9f75592af3aab913 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 12:01:40 +0300 Subject: [PATCH 33/36] add docs --- .gitea/workflows/check-license.yml | 3 +-- README.md | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index b81e017..eb12587 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -27,5 +27,4 @@ jobs: 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@feature/DO-169/start_project - with: - exclude_pattern: -ignore "foo.cpp" + diff --git a/README.md b/README.md index d39daf3..aafdaab 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,12 @@ jobs: 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 + with: + exclude_pattern: -ignore "**/*.go" -ignore "vendor/**" ``` + +## Параметры использования + +Данный парамерт позволяет исключить файлы или директории из проверки на наличие лицензии. + +**exclude_pattern:** ```-ignore "**/*.go" -ignore "vendor/**"``` From 15a836e1a3c8043334979d49cd3f75fe3480b54f Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 12:02:23 +0300 Subject: [PATCH 34/36] remove test file --- foo.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 foo.cpp diff --git a/foo.cpp b/foo.cpp deleted file mode 100644 index e69de29..0000000 From 249938af2505b3ed74aa138e659ac6369d58ff09 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 12:04:21 +0300 Subject: [PATCH 35/36] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aafdaab..74fe289 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,6 @@ jobs: ## Параметры использования -Данный парамерт позволяет исключить файлы или директории из проверки на наличие лицензии. +Данный параметр позволяет исключить файлы или директории из проверки на наличие лицензии. **exclude_pattern:** ```-ignore "**/*.go" -ignore "vendor/**"``` From 7c493f645d12588fc1b3f13a5783027df7f20840 Mon Sep 17 00:00:00 2001 From: Rustam Tagaev Date: Fri, 12 Apr 2024 12:05:50 +0300 Subject: [PATCH 36/36] set version --- .gitea/workflows/check-license.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/check-license.yml b/.gitea/workflows/check-license.yml index eb12587..113054b 100644 --- a/.gitea/workflows/check-license.yml +++ b/.gitea/workflows/check-license.yml @@ -26,5 +26,4 @@ jobs: 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@feature/DO-169/start_project - + uses: https://gitea:${{ secrets.CI_TOKEN }}@git.avroid.tech/Actions/addlicense-docker-action.git@v1