Repository navigation
60 lines (53 loc) · 1.77 KB
/
Copy pathhelm-docs.yml
File metadata and controls
60 lines (53 loc) · 1.77 KB
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
name: helm-docs
on:
pull_request:
paths:
- "charts/**"
permissions:
contents: read
pull-requests: read
jobs:
detect-charts:
runs-on: ubuntu-latest
outputs:
charts: ${{ steps.changed-charts.outputs.charts }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Changed files
id: changed-files
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
with:
files: "charts/**"
dir_names: "true"
dir_names_max_depth: "2"
- name: Determine changed charts
id: changed-charts
run: |
charts="[]"
for chart in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do
if [ -f "$chart/Chart.yaml" ]; then
charts=$(echo "$charts" | jq -c --arg c "$chart" '. + [$c]')
else
echo "$chart does not contain a Chart.yaml file, skipping"
fi
done
echo "charts=$charts" >> "$GITHUB_OUTPUT"
check-docs:
needs: detect-charts
if: needs.detect-charts.outputs.charts != '[]'
runs-on: ubuntu-latest
strategy:
matrix:
chart: ${{ fromJson(needs.detect-charts.outputs.charts) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Run helm-docs
uses: losisin/helm-docs-github-action@3a4528e97c49a5e83de6b78c50c61c8ee5c9f944 # v2.0.0
with:
chart-search-root: ${{ matrix.chart }}
template-files: README.md.gotmpl
fail-on-diff: true
version: v1.14.2