@@ -91,37 +91,49 @@ jobs:
91
91
echo "Files in PR:"
92
92
echo "$PR_FILES"
93
93
94
+ # Flag to track if we found any content files
95
+ FOUND_CONTENT_FILES=false
96
+ # Create a list of processed files
97
+ PROCESSED_FILES=""
98
+
94
99
# Process content files one by one
95
100
echo "Processing content files from PR..."
96
- FOUND_FILES=false
97
101
98
- echo "$PR_FILES" | while read -r file; do
102
+ while read -r file; do
99
103
if [[ "$file" =~ ^docusaurus/docs/cms/ || "$file" =~ ^docusaurus/docs/cloud/ || "$file" =~ ^docusaurus/static/img/assets/ ]]; then
100
104
echo "Processing content file: $file"
101
105
mkdir -p $(dirname "$file")
102
106
git checkout FETCH_HEAD -- "$file"
103
- FOUND_FILES=true
107
+ FOUND_CONTENT_FILES=true
108
+ PROCESSED_FILES="$PROCESSED_FILES $file"
104
109
fi
105
- done
110
+ done <<< "$PR_FILES"
106
111
107
- # Check if we have changes
108
- if git diff --quiet --exit-code ; then
109
- echo "No content files found or no changes detected "
112
+ # Exit if no content files were found
113
+ if [ "$FOUND_CONTENT_FILES" != "true" ] ; then
114
+ echo "No content files found in PR "
110
115
echo "has_changes=false" >> $GITHUB_OUTPUT
111
- exit 0
112
- else
113
- echo "Changes detected, will commit"
114
- echo "has_changes=true" >> $GITHUB_OUTPUT
116
+ exit 0 # Exit with success but skip PR creation
115
117
fi
118
+
119
+ # Debug: Show differences
120
+ echo "Showing diffs for processed files:"
121
+ for file in $PROCESSED_FILES; do
122
+ echo "Diff for $file:"
123
+ git diff HEAD -- "$file" || true
124
+ done
125
+
126
+ # Always create PR regardless of detected changes
127
+ echo "has_changes=true" >> $GITHUB_OUTPUT
116
128
env :
117
129
GITHUB_TOKEN : ${{ secrets.SYNC_MAIN_TO_NEXT }}
118
130
119
131
- name : Commit and create PR
120
132
if : steps.apply-changes.outputs.has_changes == 'true'
121
133
run : |
122
- # Commit changes
134
+ # Commit changes - force commit even if git thinks there are no changes
123
135
git add .
124
- git commit -m "Port PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }} to next branch"
136
+ git commit --allow-empty - m "Port PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }} to next branch"
125
137
126
138
# Push branch
127
139
git push origin next-port-pr${{ github.event.pull_request.number }}
0 commit comments