File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ name : build_directory_md
3
+
4
+ # yamllint disable-line rule:truthy
5
+ on :
6
+ workflow_dispatch :
7
+ push :
8
+ branches :
9
+ - ' main'
10
+ paths-ignore :
11
+ - ' .github/**'
12
+ - ' .scripts/**'
13
+ - ' DIRECTORY.md'
14
+
15
+ jobs :
16
+ build_directory_md :
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - uses : actions/checkout@v4
20
+
21
+ - uses : jiro4989/setup-nim-action@v1
22
+
23
+ - name : Build file
24
+ run : |
25
+ git clean -f -x -d
26
+
27
+ # Compile the script first
28
+ nim c -o:directory_script .scripts/directory.nim
29
+ compile_status=$?
30
+ if [ $compile_status -ne 0 ]; then
31
+ echo "Compilation of directory.nim failed with exit code $compile_status!"
32
+ exit $compile_status
33
+ fi
34
+
35
+ # Run the compiled script
36
+ ./directory_script > DIRECTORY.md
37
+ exec_status=$?
38
+ if [ $exec_status -ne 0 ]; then
39
+ echo "Execution of directory.nim script failed with exit code $exec_status!"
40
+ exit $exec_status
41
+ fi
42
+
43
+ - name : Setup Git configurations
44
+ run : |
45
+ git config --global user.name github-actions[bot]
46
+ git config --global user.email '[email protected] '
47
+ - name : Commit and push changes
48
+ run : |
49
+ git checkout -b directory_update-${{ github.sha }}
50
+
51
+ git add DIRECTORY.md
52
+
53
+ git commit -m "docs: update DIRECTORY.md"
54
+ git push origin directory_update-${{ github.sha }}:directory_update-${{ github.sha }}
55
+ - name : Create a pull request
56
+ run : |
57
+ if [[ $(git log --branches --not --remotes) ]]; then
58
+ gh pr create --base ${GITHUB_REF##*/} --head directory_update-${{ github.sha }} --title 'docs: update DIRECTORY.md' --body 'Updated the DIRECTORY.md file (see the diff. for changes).'
59
+ fi
60
+
61
+ ...
You can’t perform that action at this time.
0 commit comments