mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-25 15:19:58 +00:00
Fix GitHub Autocomment for ci-run/prs (#5268)
## Problem
When PR `ci-run/pr-*` is created the GitHub Autocomment with test
results are supposed to be posted to the original PR, currently, this
doesn't work.
I created this PR from a personal fork to debug and fix the issue.
## Summary of changes
- `scripts/comment-test-report.js`: use `pull_request.head` instead of
`pull_request.base` 🤦
This commit is contained in:
committed by
GitHub
parent
34e39645c4
commit
15fd188fd6
@@ -210,7 +210,7 @@ module.exports = async ({ github, context, fetch, report, coverage }) => {
|
||||
// Which PR to comment (for ci-run/pr-* it will comment the parent PR, not the ci-run/pr-* PR)
|
||||
let prToComment
|
||||
if (isPullRequest) {
|
||||
const branchName = context.payload.pull_request.base.ref.replace(/^refs\/heads\//, "")
|
||||
const branchName = context.payload.pull_request.head.ref.replace(/^refs\/heads\//, "")
|
||||
const match = branchName.match(/ci-run\/pr-(?<prNumber>\d+)/)?.groups
|
||||
if (match) {
|
||||
({ prNumber } = match)
|
||||
|
||||
Reference in New Issue
Block a user