@@ -130,11 +130,34 @@ if [[ "$BUILD_DIR" = false ]]; then
130
130
echo " ➤ Copying files..."
131
131
if [[ -e " $GITHUB_WORKSPACE /.distignore" ]]; then
132
132
echo " ℹ︎ Using .distignore"
133
+
134
+ # Deleting the git data so that the repo is reinitialized
135
+ rm -rf " $GITHUB_WORKSPACE /.git"
136
+
137
+ # Removing the existing .gitignore file to replace it with the .distignore file
138
+ rm " $GITHUB_WORKSPACE /.gitignore"
139
+
140
+ # Renaming the .distignore file to .gitignore
141
+ cp " $GITHUB_WORKSPACE /.distignore" " $GITHUB_WORKSPACE /.gitignore"
142
+
143
+ cd " $GITHUB_WORKSPACE "
144
+
145
+ # Initializing the git repo for the new .gitignore file to be taken into account
146
+ git init
147
+
148
+ git add . > /dev/null 2>&1
149
+
150
+ # Get the list files to be copied into a txt file.
151
+ git ls-files > included-files.txt
152
+
153
+ # Return to the SVN dir.
154
+ cd " $SVN_DIR "
155
+
133
156
# Copy from current branch to /trunk, excluding dotorg assets
134
- # The --filter flag will allow the full .gitignore syntax to be used in .distignore
157
+ # The --files-from flag will only copy files from the included files list
135
158
# The --delete flag will delete anything in destination that no longer exists in source
136
159
# The --itemize-changes flag will show the changes made to each file
137
- rsync -rcv --filter= " merge,- $GITHUB_WORKSPACE /.distignore " " $GITHUB_WORKSPACE /" trunk/ --delete --itemize-changes
160
+ rsync -rcv --files-from= " $GITHUB_WORKSPACE /included-files.txt " " $GITHUB_WORKSPACE /" trunk/ --delete --itemize-changes
138
161
else
139
162
echo " ℹ︎ Using .gitattributes"
140
163
0 commit comments