-
-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (41 loc) · 1.25 KB
/
readme-tree.yaml
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: Readme Tree
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tree:
runs-on: ubuntu-latest
name: readme-tree
steps:
- uses: actions/checkout@v4
- name: Install tree
run: sudo apt-get install -y tree
- name: Generate README Tree
run: |
tree -d -L 3 -I 'images|media' > tree.txt
sed -i '/<!-- readme-tree start -->/,/<!-- readme-tree end -->/c\
<!-- readme-tree start -->\
```text\
'"$(cat tree.txt | sed 's/$/\\/')"'
```\
<!-- readme-tree end -->' README.md
rm tree.txt
- name: Generate GitHub App Token
uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: update-readme-tree
commit-message: Update README Tree
title: Update README Tree
body: This PR includes new updates to the README Tree.
labels: chore
token: ${{ steps.generate-token.outputs.token }}