-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.1 KB
/
update-readme.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
38
39
40
41
42
43
44
name: Update README.md
on:
push:
paths:
- '**/*'
- '!package.json'
- '!package-lock.json'
- '!README.md'
pull_request:
paths:
- '**/*'
- '!package.json'
- '!package-lock.json'
- '!README.md'
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update Project Structure in README.md
run: |
# Get the current project structure
STRUCTURE=$(tree -I 'node_modules|.git|.github|.idea' --noreport)
# Check if the project structure has changed
if ! git diff --exit-code --quiet -- README.md; then
# Update the README.md file
echo "## 📁 Project Structure" > README.md
echo "" >> README.md
echo "```sh" >> README.md
echo "$STRUCTURE" >> README.md
echo "```" >> README.md
# Commit the changes
git add README.md
git commit -m "Update project structure in README.md"
git push
else
echo "No changes to the project structure. Skipping update."
fi