Skip to content

Commit a02ecad

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

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

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

Lines changed: 4 additions & 12 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,21 +76,12 @@ 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
83-
84-
echo "Full folder List JSON"
85-
cat all_folders.json
86-
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
81+
8782
echo "Filtered folder List JSON"
8883
cat filtered_folders.json
8984
90-
exit 1
91-
92-
rm filters.json
9385
rm all_folders.json
9486
9587
- name: Generate go docs for changed projects

0 commit comments

Comments
 (0)