-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 974 Bytes
/
tree_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
name: Generate README
on: push
jobs:
generate-tree:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Running Script
run: |
tree --noreport -I 'README.md|LICENSE|tree.txt' > tree.txt
sed -i "9,100d" README.md
echo '```' >> tree.txt
cat tree.txt >> README.md
echo '=========== README.md ==========='
cat README.md
- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "Update tree"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}