Skip to content

Commit 7d4b868

Browse files
Merge pull request #261 from element-hq/gaelg/ci-ct-lint
ct-lint.sh: parse $ / $root
2 parents 1fb0629 + 4963c30 commit 7d4b868

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

.github/workflows/build-test.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ jobs:
6262
git config --global --add safe.directory "$GITHUB_WORKSPACE"
6363
bash scripts/ct-lint.sh --config ct.yaml
6464
65-
- name: Ensure we don't use the helm $ root token in .tpl files
66-
shell: bash
67-
run: |
68-
find . -type f -name '*.tpl' -exec grep -E '\{\{[^}]*\$[^a-zA-Z0-9_][^}]*\}\}' {} + && {
69-
echo 'Error: $ is used in a .tpl files, but helm passes the local context to the special variable $ in included templates.'; exit 1
70-
} || echo "OK."
71-
7265
- uses: matrix-org/setup-python-poetry@gaelg/poetry-venv
7366
with:
7467
poetry-version: "1.8.5"

newsfragments/261.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ct-lint.sh : Run the check about $ forbidden in .tpl files.

scripts/ct-lint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ temp_output_file=$(mktemp)
1010

1111
error=1
1212

13+
find . -type f -name '*.tpl' -exec grep -E '\{\{[^}]*\$[^a-zA-Z0-9_][^}]*\}\}' {} + && {
14+
echo 'Error: $ is used in a .tpl files, but helm passes the local context to the special variable $ in included templates.'; exit 1
15+
} || echo "OK."
16+
1317
# Call the ct lint command and stream the output to stdout
1418
if ct lint "$@" 2>&1 | tee "$temp_output_file"
1519
then

0 commit comments

Comments
 (0)