File tree 4 files changed +47
-4
lines changed
4 files changed +47
-4
lines changed Original file line number Diff line number Diff line change 61
61
- uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
62
62
with :
63
63
submodules : recursive
64
- - uses : actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # tag=v4
64
+ - uses : actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 # tag=v4
65
65
- name : Install requirements for version tool
66
66
run : pip install -r python/requirements.txt
67
67
- id : prerelease
@@ -272,7 +272,7 @@ jobs:
272
272
run : git diff --exit-code
273
273
- name : Git Diff showed uncommitted changes
274
274
if : ${{ failure() }}
275
- uses : actions/github-script@7a5c598405937d486b0331594b5da2b14db670da # tag=v6
275
+ uses : actions/github-script@d50f485531ba88479582bc2da03ff424389af5c1 # tag=v6
276
276
with :
277
277
script : |
278
278
core.setFailed('Committed charts were not up to date, please regenerate and re-commit!')
@@ -316,7 +316,7 @@ jobs:
316
316
uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
317
317
with :
318
318
submodules : recursive
319
- - uses : actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # tag=v4
319
+ - uses : actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 # tag=v4
320
320
if : ${{ github.event_name == 'pull_request' }}
321
321
- uses : actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
322
322
with :
Original file line number Diff line number Diff line change 22
22
runs-on : ubuntu-latest
23
23
steps :
24
24
- uses : actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3.0.2
25
- - uses : actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08 # tag=v4
25
+ - uses : actions/setup-python@b55428b1882923874294fa556849718a1d7f2ca5 # tag=v4
26
26
with :
27
27
python-version : " 3.9"
28
28
- uses : reviewdog/action-flake8@b6435e67f0cfda225b9e0c9283cfb7ea7c551bdb # tag=v3.6.0
Original file line number Diff line number Diff line change 10
10
check-keys : false
11
11
comments :
12
12
min-spaces-from-content : 1 # Needed due to https://github.com/adrienverge/yamllint/issues/443
13
+ indentation :
14
+ indent-sequences : consistent
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Reads a file with variables to insert into templates, and templates all .*.j2 files
5
+ # in the 'docs' directory.
6
+ #
7
+ # dependencies
8
+ # pip install jinja2-cli
9
+
10
+ docs_dir=" $( dirname " $0 " ) /../docs"
11
+ templating_vars_file=" $docs_dir /templating_vars.yaml"
12
+
13
+ # Check if files need templating
14
+ if [[ -z $( find " $docs_dir " -name ' *.j2' ) ]];
15
+ then
16
+ echo " No files need templating, exiting."
17
+ exit
18
+ fi
19
+
20
+ # Check if jinja2 is there
21
+ if ! command -v jinja2 & > /dev/null
22
+ then
23
+ echo " jinja2 could not be found. Use 'pip install jinja2-cli' to install it."
24
+ exit
25
+ fi
26
+
27
+ # Check if templating vars file exists
28
+ if [[ ! -f " $templating_vars_file " ]];
29
+ then
30
+ echo " $templating_vars_file does not exist, cannot start templating."
31
+ fi
32
+
33
+ find " $docs_dir " -name ' *.j2' |
34
+ while read -r file
35
+ do
36
+ new_file_name=${file% .j2} # Remove .j2 suffix
37
+ echo " templating $new_file_name "
38
+ jinja2 " $file " " $templating_vars_file " -o " $new_file_name "
39
+ done
40
+
41
+ echo " done"
You can’t perform that action at this time.
0 commit comments