-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
86 lines (71 loc) · 2.77 KB
/
action.yml
File metadata and controls
86 lines (71 loc) · 2.77 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: DCLint GitHub Action
description: Validate and enforce best practices in Docker Compose using DCLint. Supports GitHub Annotations and Reviewdog integration.
author: Sergey Kupletsky <s.kupletsky@gmail.com>
branding:
icon: check
color: blue
inputs:
path:
description: Path(s) to file(s) or directory(ies) to lint (space-separated)
required: false
default: .
recursive:
description: Recursively search directories
required: false
default: 'false'
fix:
description: Apply automatic fixes
required: false
default: 'false'
dry-run:
description: Simulate fixes without saving
required: false
default: 'false'
formatter:
description: Output formatter (e.g. stylish, json, github)
required: false
default: 'github'
max-warnings:
description: Maximum number of warnings allowed before failure
required: false
default: '-1'
exclude:
description: Excludes specific files or directories from being checked (space-separated)
required: false
disable-rule:
description: Skips the execution of specific rules (space-separated)
required: false
debug:
description: Outputs debugging information to the console
required: false
default: 'false'
runs:
using: composite
steps:
- run: |
args=""
if [[ "${{ inputs.recursive }}" == "true" ]]; then args="$args -r"; fi
if [[ "${{ inputs.fix }}" == "true" ]]; then args="$args --fix"; fi
if [[ "${{ inputs.dry-run }}" == "true" ]]; then args="$args --fix-dry-run"; fi
if [[ "${{ inputs.formatter }}" != "" ]]; then args="$args -f ${{ inputs.formatter }}"; fi
if [[ "${{ inputs.max-warnings }}" != "-1" ]]; then args="$args --max-warnings ${{ inputs.max-warnings }}"; fi
if [[ "${{ inputs.exclude }}" != "" ]]; then args="$args --exclude ${{ inputs.exclude }}"; fi
if [[ "${{ inputs.disable-rule }}" != "" ]]; then args="$args --disable-rule ${{ inputs.disable-rule }}"; fi
if [[ "${{ inputs.debug }}" == "true" ]]; then args="$args --debug"; fi
echo "Running: npx dclint@3.1.0 ${{ inputs.path }} $args"
set +e
npx dclint@3.1.0 ${{ inputs.path }} $args
exit_code=$?
set -e
echo "### DCLint Linting Summary" >> $GITHUB_STEP_SUMMARY
echo "- Version: \`dclint@3.1.0\`" >> $GITHUB_STEP_SUMMARY
echo "- Path: \`${{ inputs.path }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Formatter: \`${{ inputs.formatter }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "$exit_code" == "0" ]]; then
echo "- Status: ✅ Success" >> $GITHUB_STEP_SUMMARY
else
echo "- Status: ❌ Failed (exit code $exit_code)" >> $GITHUB_STEP_SUMMARY
fi
exit $exit_code
shell: bash