File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Generate README
2+ on :
3+ push :
4+ pull_request :
5+ paths :
6+ - " README.md" # This isn't needed, but it's a good sanity check
7+ - " README.tmpl.md"
8+ workflow_dispatch :
9+ jobs :
10+ generate-readme :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : write
14+ steps :
15+ - uses : actions/checkout@master
16+ - run : |
17+ [ -f README.tmpl.md ] || cp README.md README.tmpl.md # Initialize README.tmpl.md
18+ printf '%s\n' "<!-- This file is generated from README.tmpl.md -->" > README.md
19+ cat README.tmpl.md >> README.md
20+ - name : CLOC
21+ uses : djdefi/cloc-action@6
22+ with :
23+ options : --md --report-file=cloc.md --hide-rate
24+ # Note: initial newline is required because files don't end with one
25+ - run : |
26+ printf '\n%s\n' '### Lines of code' >> README.md
27+ cat cloc.md >> README.md
28+ rm cloc.md
29+ - uses : stefanzweifel/git-auto-commit-action@v4
30+ with :
31+ commit_message : " chore: Generate README"
32+ # Note: README.tmpl.md is needed in the first case
33+ file_pattern : README.md README.tmpl.md
You can’t perform that action at this time.
0 commit comments