-
Notifications
You must be signed in to change notification settings - Fork 15
62 lines (53 loc) · 1.88 KB
/
build_update_repo_size.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build update repo size
on:
push:
branches: [ master ]
workflow_dispatch:
inputs:
branch:
description: 'Target branch'
required: true
default: 'master'
jobs:
build_update_repo_size:
runs-on: ubuntu-latest
steps:
# Install cloc
- name: Install cloc
run: |
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install cloc
shell: bash
# Checkout project's revision, which was pushed
- name: Checkout of the project
uses: actions/checkout@v3
with:
repository: svlad-90/${{ github.event.repository.name }}
path: ./
ref: ${{ github.ref }}
# Build repository size_md report
- name: Build repository size report
run: |
cloc ./ --md --out=./md/repo_size/repo_size.md
shell: bash
# Modify repository size report
- name: Modify repository size report
run: |
sed -i -e '1,3d' ./md/repo_size/repo_size.md
sed -i '1s/^/----\n\n/' ./md/repo_size/repo_size.md
sed -i '1s/^/[**Go to the previous page**](..\/..\/README.md)\n\n/' ./md/repo_size/repo_size.md
sed -i -e '$a\\n----\n\n' ./md/repo_size/repo_size.md
sed -i -e '$a[**Go to the previous page**](..\/..\/README.md)' ./md/repo_size/repo_size.md
shell: bash
# Commit update file
- name: Commit repository size report
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Automation: update of the repository size report"
branch: ${{ github.event.inputs.branch }}
commit_options: '--no-verify --signoff'
file_pattern: ./md/repo_size/*.md
repository: .
commit_user_name: DMA Actions Bot
commit_user_email: DMA_Actions_Bot@gmail.com
commit_author: DMA Actions Bot <DMA_Actions_Bot@gmail.com>