Skip to content

Commit d643ea5

Browse files
committed
run doc generation only for modified projects
1 parent 5af391e commit d643ea5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

.github/workflows/generate-go-docs.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
PATH=$PATH:$(go env GOPATH)/bin
6868
export PATH
6969
70+
# Find all go projects
7071
gomods_output=$(gomods 2>&1)
7172
7273
# Extract the parent directories of go.mod files
@@ -75,20 +76,15 @@ jobs:
7576
# Convert parent directories into a JSON matrix
7677
echo "$parent_folders" | jq -R -s 'split("\n") | map(select(length > 0)) | map({folder: .})' > all_folders.json
7778
78-
echo "$FILTERS" > filters.json
79-
80-
cat filters.json
81-
82-
jq --argjson filters "$(cat filters.json)" 'map(select(.folder as $folder | $filters | index($folder)))' all_folders.json > filtered_folders.json
79+
# Filter the directories that did not changeß
80+
jq --argjson filters "$FILTERS" 'map(select(.folder as $folder | $filters | index($folder)))' all_folders.json > filtered_folders.json
8381
8482
echo "Full folder List JSON"
8583
cat all_folders.json
8684
8785
echo "Filtered folder List JSON"
8886
cat filtered_folders.json
8987
90-
exit 1
91-
9288
rm filters.json
9389
rm all_folders.json
9490

0 commit comments

Comments
 (0)