File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Generate Project List
2
+
3
+ on :
4
+ schedule :
5
+ - cron : 0 0 * * *
6
+ push :
7
+ branches :
8
+ - main
9
+
10
+ jobs :
11
+ generate-list :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Checkout code
15
+ uses : actions/checkout@v3
16
+
17
+ - name : Generate project list
18
+ run : |
19
+ exclude_dirs=(.github)
20
+ exclude_files=("LICENSE" "README.md" "CONTRIBUTING.md" "Example README.md" "CODE_OF_CONDUCT.md" "PROJECTS.md")
21
+
22
+ projects=()
23
+ for dir in */; do
24
+ if [[ ! " ${exclude_dirs[@]} " =~ " ${dir%/} " ]]; then
25
+ projects+=("$dir")
26
+ fi
27
+ done
28
+
29
+ echo "# Project List" > PROJECTS.md
30
+ echo "" >> PROJECTS.md
31
+
32
+ for project in "${projects[@]}"; do
33
+ project_name=${project%/}
34
+ echo "* [$project_name](./$project_name)" >> PROJECTS.md
35
+ done
36
+
37
+ for file in "${exclude_files[@]}"; do
38
+ sed -i "/$file/d" PROJECTS.md
39
+ done
40
+
41
+ - name : Check for changes
42
+ run : |
43
+ git diff --exit-code -- PROJECTS.md
44
+ if [ $? -eq 0 ]; then
45
+ echo "No changes detected, exiting."
46
+ exit 0
47
+ fi
48
+
49
+ - name : Commit project list
50
+ run : |
51
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
52
+ git config --global user.name "project-maintainer[bot]"
53
+ git add PROJECTS.md
54
+ git commit -m "Update project list"
55
+ git push --force-with-lease
You can’t perform that action at this time.
0 commit comments