fix: use step output for PR number in Cubic review workflow (#27577)
The checkout step deletes the review-context.json file that was extracted from the artifact. The 'Post comment with Devin session link' step was trying to read this file after checkout, causing ENOENT errors. Fixed by using the PR number from the extract-prompt step output instead of reading the deleted file. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
d2d6d32bcf
commit
2231530a4a
@@ -192,9 +192,9 @@ jobs:
|
||||
? `### Devin AI is addressing Cubic AI's review feedback\n\nA Devin session has been created to address the issues identified by Cubic AI.\n\n[View Devin Session](${sessionUrl})`
|
||||
: `### Devin AI is addressing Cubic AI's review feedback\n\nNew feedback has been sent to the existing Devin session.\n\n[View Devin Session](${sessionUrl})`;
|
||||
|
||||
const fs = require('fs');
|
||||
const contextData = JSON.parse(fs.readFileSync('review-context.json', 'utf8'));
|
||||
const prNumber = contextData.pr_number;
|
||||
// Use the PR number from the extract-prompt step output instead of reading the file
|
||||
// (the file was deleted by the checkout step)
|
||||
const prNumber = parseInt('${{ steps.extract-prompt.outputs.pr-number }}', 10);
|
||||
|
||||
const { data: comment } = await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
|
||||
Reference in New Issue
Block a user