-
Notifications
You must be signed in to change notification settings - Fork 12
51 lines (43 loc) · 1.14 KB
/
caddy_fmt.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
48
49
50
51
name: "Lint my Caddyfiles"
on:
push:
branches:
- main
paths:
- '.github/workflows/caddy_fmt.yml'
- 'Caddyfile'
- '**/Caddyfile'
- '**/*.Caddyfile'
pull_request:
branches:
- main
paths:
- '.github/workflows/caddy_fmt.yml'
- 'Caddyfile'
- '**/Caddyfile'
- '**/*.Caddyfile'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: "Check out the repo"
uses: actions/checkout@v4
- name: Install Caddy
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download \
--repo caddyserver/caddy \
--pattern 'caddy_*_linux_amd64.tar.gz' \
--output caddy.tar.gz
tar -xzf caddy.tar.gz --directory /usr/local/bin
chmod +x /usr/local/bin/caddy
which caddy
- name: Format my Caddyfiles
run: |
find . -name Caddyfile -o -name '*.Caddyfile'
find . -name Caddyfile -o -name '*.Caddyfile' | xargs caddy fmt --overwrite
- name: Print changes
run: git diff
- name: Check for changes
run: git diff --exit-code