Skip to content

Commit

Permalink
CI: avoid false-positive $(params.*) detection
Browse files Browse the repository at this point in the history
Previously, the yaml-lint task (the custom script that checks for
$(params.*) usage) would flag false positives such as

    echo "set params.SOME_PARAM to do X"

Make the regex match actual param usage more closely

Signed-off-by: Adam Cmiel <[email protected]>
  • Loading branch information
chmeliik authored and MartinBasti committed Jul 24, 2024
1 parent 573b36a commit 1191b15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .tekton/tasks/yaml-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
script: |
#!/bin/bash
for task in $(find task -name '*.yaml'); do
if yq '.spec?.steps[] | .script' $task | grep -q 'params\.'; then
if yq '.spec?.steps[] | .script' $task | grep -q '\$(params\.'; then
FAILED_TASKS="$FAILED_TASKS $task"
fi
done
Expand Down

0 comments on commit 1191b15

Please sign in to comment.