Skip to content

Commit 026124f

Browse files
authored
feat: support workspace exclusion filtering in update workflow (#117)
* feat: support workspace exclusion filtering in update workflow Add exclude-workspaces input to the reusable update-plugins-repo-refs workflow. After workspace grouping, any workspace name matching an exclude pattern is removed before the matrix is built, ensuring excluded workspaces never reach the update job. Assisted-by: Claude Code Signed-off-by: Tomas Kral <tkral@redhat.com> * refactor: replace shell loop with jq with_entries for workspace exclusion Use a single jq invocation instead of nested shell loops that mutate the workspaces map while iterating over its keys. --------- Signed-off-by: Tomas Kral <tkral@redhat.com>
1 parent 57ca427 commit 026124f

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/update-plugins-repo-refs.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ on:
4141
type: string
4242
required: false
4343
default: ""
44-
44+
45+
exclude-workspaces:
46+
type: string
47+
required: false
48+
default: ""
49+
4550
jobs:
4651

4752
prepare:
@@ -353,6 +358,8 @@ jobs:
353358
- name: Gather Workspaces
354359
id: gather-workspaces
355360
shell: bash
361+
env:
362+
INPUT_EXCLUDE_WORKSPACES: ${{ inputs.exclude-workspaces }}
356363
run: |
357364
if [[ "${{ inputs.debug }}" == "true" ]]
358365
then
@@ -443,6 +450,19 @@ jobs:
443450
) | add
444451
')
445452
453+
# Filter out excluded workspaces
454+
455+
if [[ -n "${INPUT_EXCLUDE_WORKSPACES}" ]]; then
456+
workspaces=$(echo "$workspaces" | jq --arg exclude "${INPUT_EXCLUDE_WORKSPACES}" '
457+
with_entries(
458+
select(
459+
.value.workspace as $name |
460+
($exclude | split(" ") | any($name | test(.))) | not
461+
)
462+
) | if length == 0 then null else . end
463+
')
464+
fi
465+
446466
# Finally, prepare outputs for the next steps.
447467
448468
if [[ "$workspaces" == "null" ]]

0 commit comments

Comments
 (0)