Skip to content

Commit b98bd96

Browse files
committed
GitHub Actions: Fail if docs manifest outdated
1 parent 93776c0 commit b98bd96

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Keep docs manifest up to date
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
branches:
6+
- trunk
7+
paths:
8+
- docs/**/*.md
9+
10+
jobs:
11+
check-docs-manifest:
12+
name: Check docs manifest for staleness
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.4'
22+
tools: composer:v2
23+
24+
- name: Install dependencies
25+
run: composer install
26+
27+
- name: Regenerate manifest
28+
run: composer run docs:manifest
29+
30+
- name: Check whether manifest has been updated
31+
env:
32+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
33+
MANIFEST_PATH: docs/bin/manifest.json
34+
run: |
35+
if ! git diff --quiet -- "$MANIFEST_PATH"; then
36+
echo "There are documentation changes in this branch that require that the docs manifest be regenerated."
37+
echo
38+
echo "Please run 'composer run docs:manifest' and commit $MANIFEST_PATH"
39+
exit 1
40+
fi

0 commit comments

Comments
 (0)