-
Notifications
You must be signed in to change notification settings - Fork 80
72 lines (63 loc) · 2.35 KB
/
update-chart-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
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
63
64
65
66
67
68
69
70
71
72
name: lint chart readme
on:
pull_request_target:
branches:
- main
paths:
- 'charts/**'
permissions: write-all
jobs:
check-chart-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout bitnami-labs/readme-generator-for-helm
uses: actions/checkout@v4
with:
repository: 'bitnami-labs/readme-generator-for-helm'
ref: '56339fd97199c76326f224272deba14f3bcc8c3f'
path: readme-generator-for-helm
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('readme-generator-for-helm/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Install readme-generator-for-helm
run: |
cd readme-generator-for-helm
npm install
- name: Checkout project
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{ github.event.pull_request.head.repo.full_name }}
path: thisProject
- name: generate chart/README.md
run: |
echo -e "\033[32mUse readme-generator-for-helm to generate README.md\033[0m"
echo "-----------------------------"
readme-generator-for-helm/bin/index.js \
--values "thisProject/charts/spiderpool/values.yaml" \
--readme "thisProject/charts/spiderpool/README.md"
echo "-----------------------------"
- name: Upload artifact digests
uses: actions/[email protected]
with:
name: README.md
path: thisProject/charts/spiderpool/README.md
- name: Diff chart/README.md
run: |
cd thisProject
if git diff --quiet; then
echo -e "\033[32mREADME.md has not changed\033[0m"
else
echo -e "\033[31mcharts/spiderpool/README.md has changed!\033[0m"
echo -e "\033[31mPlease refer to artifact, and then commit the code.\033[0m"
echo -e "\033[31mAlternatively, copy the contents of the new README.md below into your commit.\033[0m"
echo -e "\033[31m-----------------------------\033[0m"
cat charts/spiderpool/README.md
exit 1
fi