-
Notifications
You must be signed in to change notification settings - Fork 16
33 lines (28 loc) · 981 Bytes
/
yaml-format.yml
File metadata and controls
33 lines (28 loc) · 981 Bytes
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
name: Yaml Formatter
on: push
jobs:
format-yaml:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout Code
uses: actions/checkout@v4
# Step 2: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18" # Specify your Node.js version
# Step 3: Install Prettier and ESLint globally
- name: Install Prettier
run: |
npm install -g prettier
# Step 4: Run Prettier to format code
- name: Run prettier
run: |
prettier "**/*.yml" --write
git diff
git reset --hard
prettier --check "**/*.yml"
# Step 5: Report status
- name: Complete
run: echo "Formatting completed successfully!"