Skip to content

Commit 5a0eb19

Browse files
committed
Update action
1 parent e43aebc commit 5a0eb19

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/archive2cdn.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,20 @@ jobs:
3030
"WinForms"
3131
"Wpf"
3232
)
33-
33+
3434
# Export folders array so it's accessible in the next step
3535
echo "folder_list=${folder_list[*]}" >> $GITHUB_ENV
3636
37+
# Get the absolute path of the current directory
38+
base_dir=$(pwd)
39+
3740
# Archive each folder
3841
for folder in "${folder_list[@]}"; do
3942
zip_file_name=$(echo "$folder" | sed 's/\//-/g').zip
40-
zip -r "$zip_file_name" "$folder"
43+
44+
# Change into the folder and zip all contents to the base directory
45+
(cd "$folder" && zip -r "$base_dir/$zip_file_name" .)
46+
4147
echo $zip_file_name
4248
done
4349
@@ -49,7 +55,7 @@ jobs:
4955
run: |
5056
# Convert the folders string back to an array
5157
IFS=' ' read -r -a folder_list <<< "$folder_list"
52-
58+
5359
for folder in "${folder_list[@]}"; do
5460
zip_file_name=$(echo "$folder" | sed 's/\//-/g').zip
5561
echo $zip_file_name

0 commit comments

Comments
 (0)