You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for file in ${{ steps.check-pr-files.outputs.content_files }}; do
237
-
echo "Processing file: $file"
238
-
mkdir -p $(dirname "$file")
239
-
git checkout FETCH_HEAD -- "$file"
240
-
done
211
+
FOUND_CONTENT_FILES=false
212
+
213
+
# Traiter chaque fichier individuellement sans boucle for
214
+
while IFS= read -r file; do
215
+
if [[ "$file" =~ ^docusaurus/docs/cms/ || "$file" =~ ^docusaurus/docs/cloud/ || "$file" =~ ^docusaurus/static/img/assets/ ]]; then
216
+
echo "Processing content file: $file"
217
+
mkdir -p $(dirname "$file")
218
+
git checkout FETCH_HEAD -- "$file"
219
+
FOUND_CONTENT_FILES=true
220
+
fi
221
+
done <<< "$PR_FILES"
222
+
223
+
# Vérifier si des fichiers de contenu ont été trouvés
224
+
if [ "$FOUND_CONTENT_FILES" != "true" ]; then
225
+
echo "No content files found in PR. Nothing to port."
226
+
exit 0
227
+
fi
241
228
242
229
# Commit and push
243
230
echo "Committing changes..."
244
231
git add .
245
-
git commit -m "Port PR #${{ github.event.pull_request.number }}: $PR_TITLE to next branch"
232
+
git commit -m "Port PR #$PR_NUMBER: $PR_TITLE to next branch"
246
233
247
234
echo "Pushing branch..."
248
235
git push origin $TARGET_BRANCH
@@ -251,7 +238,7 @@ jobs:
251
238
echo "Creating PR from $TARGET_BRANCH to next..."
252
239
gh pr create --base next --head $TARGET_BRANCH \
253
240
--title "[Port to next] $PR_TITLE" \
254
-
--body "Automatic port of PR #${{ github.event.pull_request.number }} to next branch.\n\nOriginal PR: #${{ github.event.pull_request.number }}\nCreated automatically after adding the 'temp - port to docs-next' label."
241
+
--body "Automatic port of PR #$PR_NUMBER to next branch.\n\nOriginal PR: #$PR_NUMBER\nCreated automatically after adding the 'temp - port to docs-next' label."
0 commit comments