-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
47 lines (42 loc) · 1.38 KB
/
action.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
40
41
42
43
44
45
46
47
---
name: 'Yamllint'
description: 'Execute yamllint'
inputs:
linters:
description: 'List of all enabled linters'
required: true
ssh-key:
description: 'ssh key'
required: true
github_token:
description: 'github token'
required: true
runs:
using: "composite"
steps:
- id: check
shell: bash
run: if echo "${{ inputs.linters }}" | grep YAMLLINT &> /dev/null; then echo "continue=true" >> "${GITHUB_OUTPUT}"; else echo "continue=false" >> "${GITHUB_OUTPUT}"; fi
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4
if: ${{ steps.check.outputs.continue == 'true' }}
with:
ssh-key: ${{ inputs.ssh-key }}
persist-credentials: true
lfs: true
submodules: recursive
- shell: bash
if: ${{ steps.check.outputs.continue == 'true' }}
run: grep path .gitmodules | grep -v scripts | awk '{ print $3 }' | xargs rm -rf || true
# https://github.com/marketplace/actions/run-yamllint-with-reviewdog
- uses: reviewdog/action-yamllint@v1
if: ${{ steps.check.outputs.continue == 'true' }}
with:
fail_on_error: true
filter_mode: nofilter
github_token: ${{ inputs.github_token }}
level: info
reporter: github-pr-review
# reviewdog_flags:
# https://yamllint.readthedocs.io/en/stable/
yamllint_flags: "--strict ."