Skip to content

Commit 2c77eaa

Browse files
committed
Add a Caddyfile linting workflow
1 parent d6cd398 commit 2c77eaa

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/lint.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Linting
2+
on: [pull_request]
3+
4+
jobs:
5+
caddyfmt:
6+
name: caddyfmt
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- name: Install caddy
12+
run: |
13+
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
14+
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | \
15+
sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
16+
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | \
17+
sudo tee /etc/apt/sources.list.d/caddy-stable.list
18+
sudo apt update
19+
sudo apt install caddy
20+
21+
- name: Set up reviewdog
22+
run: |
23+
mkdir -p "$HOME/bin"
24+
curl -sfL \
25+
https://github.com/reviewdog/reviewdog/raw/master/install.sh | \
26+
sh -s -- -b "$HOME/bin"
27+
echo "$HOME/bin" >> $GITHUB_PATH
28+
29+
- name: Run caddy validate
30+
run: caddy validate
31+
32+
- name: Run caddy fmt
33+
run: caddy fmt --overwrite
34+
35+
- name: Run reviewdog
36+
uses: reviewdog/action-suggester@v1
37+
with:
38+
fail_on_error: true
39+
tool_name: 'caddy fmt'

0 commit comments

Comments
 (0)