Skip to content

Commit da061cc

Browse files
authored
chore: use file pipe instead of cat... (#1824)
chore: use file pipe instead of cat (https://www.shellcheck.net/wiki/SC2013) to fix parsing problems; improve call to action too Signed-off-by: Nick Boldt <nboldt@redhat.com>
1 parent 282db5e commit da061cc

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

.github/workflows/create-release-branch.yaml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,11 @@ jobs:
8484
done
8585
8686
missingPlugins=false
87-
for required in $(cat required-plugins)
88-
do
89-
if [[ "$(echo $required | sed 's/ *//')" == "" || "$(echo $required | sed 's/^#.*//')" == "" ]]
90-
then
91-
continue
92-
fi
87+
while IFS= read -r line; do
88+
echo "Checking required plugin: ${line}"
9389
94-
echo "Checking required plugin: ${required}"
95-
96-
workspacePath="workspaces/$(echo ${required} | cut -d'/' -f1)"
97-
pluginPath="$(echo ${required} | cut -d'/' -f2-)"
90+
workspacePath="workspaces/$(echo ${line} | cut -d'/' -f1)"
91+
pluginPath="$(echo ${line} | cut -d'/' -f2-)"
9892
9993
if [[ ! -d "${workspacePath}" ]]
10094
then
@@ -105,11 +99,11 @@ jobs:
10599
106100
if ! grep -q "${pluginPath}:" "${workspacePath}/plugins-list.yaml"
107101
then
108-
echo ::error ::Required plugin ${pluginPath} of workspace ${workspacePath} is missing.
102+
echo ::error ::Required plugin ${pluginPath} is not in ${workspacePath}/plugins-list.yaml!
109103
missingPlugins=true
110104
continue
111105
fi
112-
done
106+
done < <(grep -E -v '^ *#|^ *$' required-plugins | sort -u)
113107
114108
if [[ "${missingPlugins}" == "true" ]]
115109
then

0 commit comments

Comments
 (0)