@@ -84,10 +84,16 @@ jobs:
84
84
run : |
85
85
pr_number="${{ steps.check_pr_commit.outputs.pr_number }}"
86
86
87
+ echo "👀 Looking for PR $pr_number ..."
88
+
89
+
87
90
# Get PR information using GitHub API
88
91
pr_info=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
89
92
"https://api.github.com/repos/${{ github.repository }}/pulls/$pr_number")
90
93
94
+
95
+ echo "👀 PR data $pr_info ..."
96
+
91
97
pr_title=$(echo "$pr_info" | jq -r '.title')
92
98
pr_author=$(echo "$pr_info" | jq -r '.user.login')
93
99
pr_url=$(echo "$pr_info" | jq -r '.html_url')
@@ -169,6 +175,9 @@ jobs:
169
175
echo "📑 Will only sync these paths: $SYNCED_PATHS"
170
176
git format-patch $parent_commit..$commit_sha --stdout -- $SYNCED_PATHS > changes.patch
171
177
178
+ echo "📋 Generated Patch: "
179
+ cat changes.patch
180
+
172
181
cd target-docs
173
182
174
183
# Apply the patch
@@ -205,12 +214,20 @@ jobs:
205
214
run : |
206
215
cd target-docs
207
216
217
+ echo "🔍 Checking for changes..."
218
+
219
+ git status
220
+
221
+ echo "=> Adding changes..."
222
+
208
223
git add .
209
224
225
+ echo "==> Checking if there are staged changes..."
210
226
if git diff --staged --quiet; then
211
227
echo "has_changes=false" >> $GITHUB_OUTPUT
212
228
echo "ℹ️ No changes to commit"
213
229
else
230
+ echo "=> Changes detected..."
214
231
echo "has_changes=true" >> $GITHUB_OUTPUT
215
232
216
233
pr_number="${{ steps.check_pr_commit.outputs.pr_number }}"
@@ -219,20 +236,26 @@ jobs:
219
236
pr_url="${{ steps.get_pr_info.outputs.pr_url }}"
220
237
commit_sha="${{ steps.check_pr_commit.outputs.commit_sha }}"
221
238
239
+ echo "=> Creating commit message..."
240
+ echo " - PR Number: $pr_number"
241
+ echo " - PR Title: $pr_title"
242
+ echo " - PR Author: $pr_author"
243
+ echo " - PR URL: $pr_url"
244
+ echo " - Commit SHA: $commit_sha"
245
+
222
246
# Create commit message with reverse sync marker
223
- cat > commit_message.txt << EOF
224
- [reverse-sync] Sync documentation changes from devops-pipelines-docs PR #$pr_number
225
247
226
- This commit incorporates changes from external contributors to the devops-pipelines-docs repository.
248
+ echo "[reverse-sync] Sync documentation changes from devops-pipelines-docs PR #$pr_number" > commit_message.txt
249
+ echo "" >> commit_message.txt
250
+ echo "- Title: $pr_title" >> commit_message.txt
251
+ echo "- Author: $pr_author" >> commit_message.txt
252
+ echo "- URL: $pr_url" >> commit_message.txt
253
+ echo "- Commit: $commit_sha" >> commit_message.txt
227
254
228
- 📋 Original PR Details:
229
- - Title: $pr_title
230
- - Author: $pr_author
231
- - URL: $pr_url
232
- - Commit: $commit_sha
255
+ echo "=> Commit message:"
256
+ cat commit_message.txt
233
257
234
- 🔄 This is a reverse sync commit - it should not trigger forward sync.
235
- EOF
258
+ echo "=> Committing changes..."
236
259
237
260
git commit -F commit_message.txt
238
261
rm commit_message.txt
0 commit comments