-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-multi-dockerfile.yml
More file actions
42 lines (37 loc) · 1.24 KB
/
Copy pathexample-multi-dockerfile.yml
File metadata and controls
42 lines (37 loc) · 1.24 KB
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
40
41
42
name: LayerLint - Multi Dockerfile Scan
on:
push:
paths:
- '**/Dockerfile*'
- '.github/workflows/example-multi-dockerfile.yml'
jobs:
find-dockerfiles:
runs-on: ubuntu-latest
outputs:
dockerfiles: ${{ steps.find.outputs.dockerfiles }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Find all Dockerfiles
id: find
run: |
FILES=$(find . -type f -name "Dockerfile*" | jq -R -s -c 'split("\n")[:-1]')
echo "dockerfiles=$FILES" >> $GITHUB_OUTPUT
echo "Found Dockerfiles: $FILES"
lint:
needs: find-dockerfiles
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile: ${{ fromJson(needs.find-dockerfiles.outputs.dockerfiles) }}
fail-fast: false
name: Scan ${{ matrix.dockerfile }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install LayerLint
run: |
curl -sSL https://github.com/vviveksharma/layerLint/releases/download/v1.0.0/layerLint_1.0.0_Linux_x86_64.tar.gz | tar xz
chmod +x layerlint
- name: Scan ${{ matrix.dockerfile }}
run: ./layerlint scan --dockerfile ${{ matrix.dockerfile }} --fail-on-severity medium