-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (36 loc) Β· 1.61 KB
/
common-static-analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Markdown, Docker, and Shell Static Analysis
on: [push, pull_request, workflow_dispatch]
env:
MARKDOWNLINT_CONFIG: etc/static-analysis/markdownlint.json
HADOLINT_DOCKER: hadolint/hadolint:v2.8.0
SHELLCHECK_DOCKER: koalaman/shellcheck:v0.9.0
MARKDOWN_DOCKER: ghcr.io/igorshubovych/markdownlint-cli:v0.32.2
jobs:
docker-shell-markdown-static-analysis:
runs-on: ubuntu-22.04
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v3
- name: Pulling Docker containers
run: |
docker pull $HADOLINT_DOCKER
docker pull $SHELLCHECK_DOCKER
docker pull $MARKDOWN_DOCKER
- name: Dockerfile linting with Hadolint
run: |
while read -r file;
do
docker run --rm -i $HADOLINT_DOCKER < "$file"
done < <(find . -type f ! -path "*/node_modules/*" -name "Dockerfile" -print)
- name: Shellscript linting with ShellCheck
run: |
while read -r file;
do
docker run --rm -v "$PWD:/mnt" $SHELLCHECK_DOCKER --format=gcc "$file"
done < <(find . -type f ! -path "*node_modules/*" ! -path "*local/*" ! -path "*lib/*" ! -path "./.git/*" -name "*.sh" -print)
- name: Markdown linting with markdownlint-cli
run: |
while read -r file;
do
docker run -v $PWD:/workdir $MARKDOWN_DOCKER -i paper.md --config $MARKDOWNLINT_CONFIG "$file"
done < <(find . -type f ! -path "**/node_modules/*" ! -path "*local/*" ! -path "*lib/*" ! -path "**/.git/*" -name "*.md" -print)