Skip to content

Commit 66ec6fb

Browse files
authored
Merge pull request #13 from ahoppen/yamllint
Add a soundness check to lint YAML files
2 parents 70a0f17 + 74175c4 commit 66ec6fb

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: default
2+
3+
rules:
4+
line-length: false
5+
document-start: false
6+
truthy:
7+
check-keys: false # Otherwise we get a false positive on GitHub action's `on` key

.github/workflows/soundness.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ on:
5151
type: string
5252
description: "Container image for the shell check job. Defaults to latest Swift Ubuntu image."
5353
default: "swift:6.0-noble"
54+
yamllint_enabled:
55+
type: boolean
56+
description: "Boolean to enable the YAML lint job. Defaults to true."
57+
default: true
5458

5559
## We are cancelling previously triggered workflow runs
5660
concurrency:
@@ -177,3 +181,18 @@ jobs:
177181
run: |
178182
apt-get -qq update && apt-get -qq -y install shellcheck
179183
git ls-files -z '*.sh' | xargs -0 shellcheck
184+
185+
yaml-lint:
186+
name: Lint YAML
187+
if: ${{ inputs.yamllint_enabled }}
188+
runs-on: ubuntu-latest
189+
timeout-minutes: 5
190+
steps:
191+
- name: Checkout repository
192+
uses: actions/checkout@v4
193+
with:
194+
persist-credentials: false
195+
- name: Run yamllint
196+
run: |
197+
curl -s https://raw.githubusercontent.com/swiftlang/github-workflows/refs/heads/main/.github/workflows/configs/yamllint.yml > /tmp/yamllint.yml
198+
yamllint --strict --config-file /tmp/yamllint.yml ${GITHUB_WORKSPACE}

0 commit comments

Comments
 (0)