-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.42 KB
/
shell-docs.yml
File metadata and controls
55 lines (47 loc) · 1.42 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
---
name: Generate shell script docs
on:
- pull_request
jobs:
shdoc:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Checkout shdoc
uses: actions/checkout@v2
with:
path: shdoc
repository: reconquest/shdoc
submodules: recursive
- name: Setup shdoc
shell: bash
run: |
cd shdoc
sudo make install
cd ..
sudo rm -rf shdoc vendor || echo "DONE"
- name: Render shdoc
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for FILE in $(find . -type f -iname "*.sh" | grep -v test | sed 's/\.\///'); do
TARGET_DIR=$(dirname "${FILE}")
[ -d "docs/${TARGET_DIR}" ] || mkdir docs/${TARGET_DIR}
TARGETFILE="${FILE%.sh}.md"
shdoc < ${FILE} > docs/${TARGETFILE}
done
if git diff-index --quiet HEAD; then
echo "No shell documentation changes detected"
else
git config user.email github-actions@github.com
git config user.name github-actions
for F in $(git ls-files --others --exclude-standard); do
git add "${F}"
done
git commit -am "shdoc: Automated shell script document updates" > /dev/null || echo "Nothing to commit"
git push --quiet
fi