-
Notifications
You must be signed in to change notification settings - Fork 367
45 lines (38 loc) · 1.13 KB
/
check-docs.yaml
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
name: Check Docs
on:
pull_request:
jobs:
check_changes:
runs-on: ubuntu-latest
outputs:
docs_changes: ${{ steps.check_file_changed.outputs.changed }}
steps:
- uses: actions/checkout@v3
with:
# Checkout as many commits as needed for the diff
fetch-depth: 2
# Generate docs
# Return true/false if docs are changed
- id: check_file_changed
run: |
./gendocs.sh
if git diff --name-only | grep -E "^docs|devspace-schema.json"; then
echo "{changed}={True}" >> $GITHUB_OUTPUT
else
echo "{changed}={False}" >> $GITHUB_OUTPUT
fi
check-docs:
runs-on: ubuntu-latest
needs: check_changes
if: needs.check_changes.outputs.docs_changes == 'True'
permissions:
pull-requests: write
steps:
- uses: mshick/add-pr-comment@v2
with:
allow-repeats: true
message: |
**Docs Update Needed!**
It seems like you need to run `gendocs.sh` in order to update the docs.
Please run this command and commit before merging.
Thanks!