Skip to content

Commit 7b61968

Browse files
authored
Merge pull request #3 from alliander-opensource/fix/format-yaml-code
Validate yaml files formatting using prettier
2 parents b85f0c9 + b8e3108 commit 7b61968

File tree

3 files changed

+250
-249
lines changed

3 files changed

+250
-249
lines changed

.github/workflows/yml-lint.yaml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
name: YAML Formatting
1+
name: YAML Lint
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
45

56
jobs:
6-
format:
7+
lint:
78
runs-on: ubuntu-latest
89
steps:
910
- name: Checkout repository
@@ -12,13 +13,5 @@ jobs:
1213
- name: Install Prettier
1314
run: npm install --global prettier
1415

15-
- name: Format YAML files
16-
run: prettier --write "**/*.yml"
17-
18-
- name: Commit changes
19-
run: |
20-
git config --global user.name "github-actions"
21-
git config --global user.email "actions@github.com"
22-
git add .
23-
git diff --quiet && git diff --staged --quiet || git commit -m "chore: auto-format YAML files" -s
24-
git push
16+
- name: Check YAML formatting
17+
run: prettier --check "**/*.yaml"

0 commit comments

Comments
 (0)