Merge pull request #110 from AxisCommunications/sync-20231115-1 #167
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint codebase | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
run-linters: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check that no private Docker Hub URLs are used | |
run: | | |
priv_url=hub.docker.com/repository/docker/axisecp | |
pub_url=hub.docker.com/r/axisecp | |
ret=0 | |
# Set +e to not having to handle the grep exit status | |
__docker_grep_res=$(grep -nir "$priv_url" --exclude-dir=.github || :) | |
[ -z "$__docker_grep_res" ] || { | |
printf "\n\nError: Private Docker Hub URL is used\n" | |
printf "Private: $priv_url\nPublic: $pub_url\n\n" | |
printf "Found following private URLs:\n$__docker_grep_res\n\n" | |
ret=1 | |
} | |
exit $ret | |
- uses: github/super-linter/slim@v5 | |
env: | |
DEFAULT_BRANCH: main | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
LINTER_RULES_PATH: / | |
FILTER_REGEX_EXCLUDE: docs/develop/manifest-schemas/schema-field-descriptions-v\d+(\.\d){1,2}(-[a-z0-9]*)*.md | |
VALIDATE_MARKDOWN: true | |
MARKDOWN_CONFIG_FILE: .markdownlint.yml | |
VALIDATE_NATURAL_LANGUAGE: true |