diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96e14f6bbb..a4d35ed96e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,6 @@ on: push: + branches: [ master ] pull_request: branches: [ master ] workflow_dispatch: @@ -11,3 +12,4 @@ jobs: - uses: actions/checkout@v3 - run: make awesome_lint - run: make export + - run: make url_check diff --git a/.github/workflows/update-metadata.yml b/.github/workflows/update-metadata.yml index 9b01c206e0..5ced39267f 100644 --- a/.github/workflows/update-metadata.yml +++ b/.github/workflows/update-metadata.yml @@ -20,3 +20,4 @@ jobs: git add software/ tags/ platforms/ licenses*.yml git diff-index --quiet HEAD || git commit -m "[bot] update projects metadata" git push + - run: make url_check diff --git a/.hecat/url-check.yml b/.hecat/url-check.yml new file mode 100644 index 0000000000..4ba80e5648 --- /dev/null +++ b/.hecat/url-check.yml @@ -0,0 +1,17 @@ +steps: + - name: check URLs + module: processors/url_check + module_options: + source_directories: + - software + - tags + source_files: + - licenses.yml + check_keys: + - url + - source_code_url + - website_url + - demo_url + errors_are_fatal: True + exclude_regex: + - '^https://github.com/[\w\.\-]+/[\w\.\-]+$' # don't check URLs that will be processed by the github_metadata module diff --git a/Makefile b/Makefile index 4ea8db3267..8da8fa4dca 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,11 @@ export: install hecat --config .hecat/export.yml cd awesome-selfhosted && git diff --color=always +.PHONY: url_check # check URLs for dead links or other connection problems +url_check: install + source .venv/bin/activate && \ + hecat --config .hecat/url-check.yml + .PHONY: help # generate list of targets with descriptions help: @grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20