mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-22 21:59:59 +00:00
Misc workflows: fix quotes in bash (#5235)
This commit is contained in:
committed by
GitHub
parent
485a2cfdd3
commit
d15563f93b
@@ -205,20 +205,22 @@ const parseCoverageSummary = async ({ summaryJsonUrl, coverageUrl, fetch }) => {
|
||||
}
|
||||
|
||||
module.exports = async ({ github, context, fetch, report, coverage }) => {
|
||||
// If we run the script in the PR or in the branch (main/release/...)
|
||||
const isPullRequest = !!context.payload.pull_request
|
||||
// Which PR to comment (for ci-run/pr-* it will comment the parent PR, not the ci-run/pr-* PR)
|
||||
let prToComment
|
||||
const branchName = context.payload.pull_request.base.ref.replace(/^refs\/heads\//, "")
|
||||
const match = branchName.match(/^ci-run\/pr-(?<prNumber>\d+)$/)?.groups
|
||||
if (match) {
|
||||
({ prNumber } = match)
|
||||
prToComment = parseInt(prNumber, 10)
|
||||
} else {
|
||||
prToComment = context.payload.number
|
||||
if (isPullRequest) {
|
||||
const branchName = context.payload.pull_request.base.ref.replace(/^refs\/heads\//, "")
|
||||
const match = branchName.match(/ci-run\/pr-(?<prNumber>\d+)/)?.groups
|
||||
if (match) {
|
||||
({ prNumber } = match)
|
||||
prToComment = parseInt(prNumber, 10)
|
||||
} else {
|
||||
prToComment = context.payload.number
|
||||
}
|
||||
}
|
||||
// Marker to find the comment in the subsequent runs
|
||||
const startMarker = `<!--AUTOMATIC COMMENT START #${prToComment}-->`
|
||||
// If we run the script in the PR or in the branch (main/release/...)
|
||||
const isPullRequest = !!context.payload.pull_request
|
||||
// Latest commit in PR or in the branch
|
||||
const commitSha = isPullRequest ? context.payload.pull_request.head.sha : context.sha
|
||||
// Let users know that the comment is updated automatically
|
||||
|
||||
Reference in New Issue
Block a user