Skip to content

Commit 8d93b48

Browse files
committed
fixed pr-describe workflow
1 parent ff311c0 commit 8d93b48

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/pr-describe.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,19 @@ jobs:
105105
106106
fs.writeFileSync('files.txt', filesList);
107107
108-
console.log(`📝 Generated commits.txt and files.txt`);
108+
// Get the actual diff
109+
const { data: diff } = await github.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
110+
owner: context.repo.owner,
111+
repo: context.repo.repo,
112+
pull_number: prNumber,
113+
mediaType: {
114+
format: 'diff'
115+
}
116+
});
117+
118+
fs.writeFileSync('pr.diff', diff);
119+
120+
console.log(`📝 Generated commits.txt, files.txt, and pr.diff`);
109121
110122
} catch (error) {
111123
core.setFailed(`❌ Failed to fetch PR details: ${error.message}`);
@@ -128,6 +140,9 @@ jobs:
128140
129141
**Changed Files:**
130142
$(cat files.txt)
143+
144+
**Diff:**
145+
$(cat pr.diff)
131146
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
132147
timeout: 300000 # 5 minutes
133148

@@ -212,5 +227,5 @@ jobs:
212227
if: always()
213228
run: |
214229
set -euo pipefail
215-
rm -f commits.txt files.txt || true
230+
rm -f commits.txt files.txt pr.diff || true
216231
echo "🧹 Cleaned up temporary files"

0 commit comments

Comments
 (0)