-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.04 KB
/
dockerfile-test.yaml
File metadata and controls
44 lines (40 loc) · 1.04 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
43
name: Test
on:
workflow_call:
inputs:
RUNS_ON:
type: string
default: ubuntu-latest
HADOLINT_CHECK_ENABLE:
type: boolean
default: false
HADOLINT_CHECK_DIR:
default: .
type: string
description: Path to file
jobs:
vars:
name: Generation vars
runs-on: ${{ inputs.RUNS_ON }}
outputs:
paths: ${{ steps.paths.outputs.value }}
steps:
- uses: actions/checkout@v4
- name: Get parts
id: paths
run: |
files=$(find ${{ inputs.HADOLINT_CHECK_DIR }} -type f -name Dockerfile | sed "s/.*/'&'/" | paste -sd, -)
echo "value=[${files}]" >> "$GITHUB_OUTPUT"
liner:
if: ${{ inputs.HADOLINT_CHECK_ENABLE }}
needs: vars
name: hadolint check dockerfiles
runs-on: ${{ inputs.RUNS_ON }}
strategy:
matrix:
path: ${{ fromJson(needs.vars.outputs.paths) }}
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.path }}