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
console.log(`✅ Found existing PR: #${pr.number}. No new PR will be created.`)
758
+
759
+
// Optional: Post a comment to the existing PR to notify of the update
760
+
const updateComment = `🔄 **Claude Code has updated this branch** with new changes.\n\n[View the latest workflow run](https://github.com/${owner}/${repo}/actions/runs/${{ github.run_id }})`
761
+
await github.rest.issues.createComment({
762
+
owner,
763
+
repo,
764
+
issue_number: pr.number,
765
+
body: updateComment,
766
+
})
767
+
768
+
} else {
769
+
// 3. If no PR exists, create one
770
+
console.log(`No existing PR found. Attempting to create a new PR for branch: ${branchName}`)
const failureComment = `❌ **Automatic PR creation failed**\n\n**Error:** \`${error.message}\`\n\n**Solution**: A branch named \`${branchName}\` was created with the changes. Please create a PR from it manually or rerun the job.\n**Details**: [Actions run log](${{ github.server_url }}/${owner}/${repo}/actions/runs/${{ github.run_id }})`
773
821
await github.rest.issues.createComment({
774
822
issue_number: issueNumber,
775
-
owner: context.repo.owner,
776
-
repo: context.repo.repo,
777
-
body: `❌ **Automatic PR creation failed**\n\n**Error:** \`${error.message}\`\n\n**Solution**: A branch named \`${branchName}\` was created with the changes. Please create a PR from it manually or rerun the job.\n**Details**: [Actions run log](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})`
0 commit comments