forked from freifunk-berlin/bbb-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (26 loc) · 1.05 KB
/
check-interface-names.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
---
name: Check interface names
on: [push, pull_request] # yamllint disable-line rule:truthy
jobs:
check-interface-names:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0
# Get a list of changed files and pass them to the script
- name: Get Changed Files and Run interface name check
run: |
# Fetch previous commits for comparison
git fetch origin main
# Get list of changed files compared to main branch
changed_files=$(git diff --name-only origin/main)
# Filter out only the location files from the list of changed files
location_files=$(echo "$changed_files" | grep -E '^locations/.*\.yml$' || true)
if [ -z "$location_files" ]; then
echo "No location files changed, skipping check."
exit 0
fi
# Run the interface name check script with the filtered location files
./.github/checks/check-interface-names.sh "$location_files"