Skip to content

Commit

Permalink
Add syntax check for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
larsks committed Oct 17, 2023
1 parent 94853dc commit 1d6c439
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/update-dns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ on:
- 'zonefiles/**.zone'

jobs:
validate-zonefiles:
uses: ./.github/workflows/validate-zonefiles.yaml

update-dns:
needs:
- validate-zonefiles
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/validate-zonefiles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Validate zonefile syntax

on:
pull_request:
paths:
- 'zonefiles/**.zone'
push:
branches-ignore:
- main
paths:
- 'zonefiles/**.zone'

jobs:
named-checkzone:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Verify zonefile syntax
run: |
set -e
for zonefile in zonefiles/*.zone; do
zone=${zonefile##*/}
zone=${zone%.zone}
named-checkzone "$zone" "$zonefile"
done

0 comments on commit 1d6c439

Please sign in to comment.