-
Notifications
You must be signed in to change notification settings - Fork 63
58 lines (48 loc) · 2.07 KB
/
Copy pathcheck-provider-docs.yml
File metadata and controls
58 lines (48 loc) · 2.07 KB
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
52
53
54
55
56
57
58
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: MIT
name: Check provider documentation
on: pull_request
permissions:
contents: read
concurrency:
group: check-provider-docs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check-provider-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
persist-credentials: false
- name: Check new providers are documented
run: |
set -euo pipefail
BASE="${{ github.base_ref }}"
MISSING=()
# SMS sub-drivers: extract name: from createSettings() and check Admin Documentation
while IFS= read -r file; do
[[ -z "$file" ]] && continue
NAME=$(grep -oP "(?<=name: ')([^']+)" "$file" | head -1)
[[ -z "$NAME" ]] && continue
if ! grep -qi "$NAME" "doc/Admin Documentation.md"; then
MISSING+=("SMS driver '$NAME' (${file}) missing from doc/Admin Documentation.md")
fi
done < <(git diff --name-only --diff-filter=A "origin/${BASE}...HEAD" -- 'lib/Provider/Channel/SMS/Provider/Drivers/*.php')
# New top-level channels: check channel directory name in Admin Documentation
while IFS= read -r file; do
[[ -z "$file" ]] && continue
CHANNEL=$(basename "$(dirname "$file")")
if ! grep -qi "$CHANNEL" "doc/Admin Documentation.md"; then
MISSING+=("Channel '$CHANNEL' (${file}) missing from doc/Admin Documentation.md")
fi
done < <(git diff --name-only --diff-filter=A "origin/${BASE}...HEAD" -- 'lib/Provider/Channel/*/Gateway.php')
if [[ ${#MISSING[@]} -gt 0 ]]; then
echo "::error::The following providers are missing documentation:"
for m in "${MISSING[@]}"; do
echo "::error:: - $m"
done
exit 1
fi
echo "All new providers are documented."