Skip to content

Commit 9e56293

Browse files
leogrpoiana
authored andcommitted
fix(.github/workflow): strict naming convention for changed rules files
Signed-off-by: Leonardo Grasso <[email protected]>
1 parent 59bf03b commit 9e56293

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/rules.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ jobs:
3131
- name: Find changed rules files
3232
id: set-changed-files
3333
run: |
34-
# if we skip changed-files because we're not in a pull-request,
35-
# then we consider all the rules contained in the repo
34+
# Find any changed file located under the /rules folder that matches the naming convention <ruleset>_rules.yaml.
35+
# See https://github.com/falcosecurity/rules/blob/main/README.md#naming-convention for details.
36+
# Additionally, if we skip changed-files because we're not in a pull request,
37+
# then we consider all the rules contained in the repository.
3638
all_files="${{ steps.changed-files.outputs.all }}"
3739
values=""
3840
if [ -z "$all_files" ]; then
39-
values=$(ls rules/*.yaml)
41+
values=$(ls rules/*_rules.yaml)
4042
else
4143
for changed_file in $all_files; do
42-
if [[ "${changed_file}" =~ ^rules/.* ]]; then
44+
if [[ "${changed_file}" =~ ^rules/[^/]*_rules\.yaml$ ]]; then
4345
values=${values}${changed_file}$'\n'
4446
fi
4547
done

0 commit comments

Comments
 (0)