Skip to content

Commit bec964d

Browse files
Create lint_nginx.yml
1 parent 16c22a1 commit bec964d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/lint_nginx.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Nginx Config Linter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
nginx-lint:
11+
name: Validate Nginx Config
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Install Nginx
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y nginx
22+
23+
- name: Find and Test Nginx Config Files
24+
run: |
25+
set -e # Exit on error
26+
find . -name "reverse-proxy.conf" -print0 | while IFS= read -r -d '' file; do
27+
echo "Checking $file..."
28+
sudo nginx -t -c "$(realpath "$file")"
29+
done

0 commit comments

Comments
 (0)