-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (30 loc) · 1010 Bytes
/
UpdateDirectory.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
34
35
36
37
# This GitHub Action updates the DIRECTORY.md file (if needed) when doing a git push
name: Update Directory
on:
push:
branches-ignore: "master"
jobs:
updateDirectory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- name: 📦 Install dependencies
run: npm ci
- name: 🗄️ Create Directory from JS files
run: node .github/workflows/UpdateDirectory.js
- name: Configure Github Action
run: |
git config --global user.name github-actions
git config --global user.email '${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com'
- name: 🤓 Commit & push new Directory (if needed)
run: |
if [[ `git status --porcelain` ]]; then
git commit -am "Updated Documentation in DIRECTORY.md"
git push
else
echo "NO CHANGES DETECTED"
fi