mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-25 23:29:59 +00:00
Misc workflows: fix quotes in bash (#5235)
This commit is contained in:
committed by
GitHub
parent
485a2cfdd3
commit
d15563f93b
2
.github/workflows/approved-for-ci-run.yml
vendored
2
.github/workflows/approved-for-ci-run.yml
vendored
@@ -74,7 +74,7 @@ jobs:
|
|||||||
Feel free to review/comment/discuss the original PR #${PR_NUMBER}.
|
Feel free to review/comment/discuss the original PR #${PR_NUMBER}.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ALREADY_CREATED="$(gh pr --repo '${GITHUB_REPOSITORY}' list --head '${HEAD}' --base 'main' --json 'number' --jq '.[].number')"
|
ALREADY_CREATED="$(gh pr --repo ${GITHUB_REPOSITORY} list --head ${HEAD} --base main --json number --jq '.[].number')"
|
||||||
if [ -z "${ALREADY_CREATED}" ]; then
|
if [ -z "${ALREADY_CREATED}" ]; then
|
||||||
gh pr --repo "${GITHUB_REPOSITORY}" create --title "CI run for PR #${PR_NUMBER}" \
|
gh pr --repo "${GITHUB_REPOSITORY}" create --title "CI run for PR #${PR_NUMBER}" \
|
||||||
--body-file "body.md" \
|
--body-file "body.md" \
|
||||||
|
|||||||
2
.github/workflows/build_and_test.yml
vendored
2
.github/workflows/build_and_test.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
if [ "${{ contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) }}" = "true" ]; then
|
if [ "${{ contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) }}" = "true" ]; then
|
||||||
MESSAGE="Please create a PR from a branch of ${GITHUB_REPOSITORY} instead of a fork"
|
MESSAGE="Please create a PR from a branch of ${GITHUB_REPOSITORY} instead of a fork"
|
||||||
else
|
else
|
||||||
MESSAGE="The PR should be reviewed and labelled with `approved-for-ci-run` to trigger a CI run"
|
MESSAGE="The PR should be reviewed and labelled with 'approved-for-ci-run' to trigger a CI run"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo >&2 "We don't run CI for PRs from forks"
|
echo >&2 "We don't run CI for PRs from forks"
|
||||||
|
|||||||
@@ -205,20 +205,22 @@ const parseCoverageSummary = async ({ summaryJsonUrl, coverageUrl, fetch }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = async ({ github, context, fetch, report, coverage }) => {
|
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)
|
// Which PR to comment (for ci-run/pr-* it will comment the parent PR, not the ci-run/pr-* PR)
|
||||||
let prToComment
|
let prToComment
|
||||||
const branchName = context.payload.pull_request.base.ref.replace(/^refs\/heads\//, "")
|
if (isPullRequest) {
|
||||||
const match = branchName.match(/^ci-run\/pr-(?<prNumber>\d+)$/)?.groups
|
const branchName = context.payload.pull_request.base.ref.replace(/^refs\/heads\//, "")
|
||||||
if (match) {
|
const match = branchName.match(/ci-run\/pr-(?<prNumber>\d+)/)?.groups
|
||||||
({ prNumber } = match)
|
if (match) {
|
||||||
prToComment = parseInt(prNumber, 10)
|
({ prNumber } = match)
|
||||||
} else {
|
prToComment = parseInt(prNumber, 10)
|
||||||
prToComment = context.payload.number
|
} else {
|
||||||
|
prToComment = context.payload.number
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Marker to find the comment in the subsequent runs
|
// Marker to find the comment in the subsequent runs
|
||||||
const startMarker = `<!--AUTOMATIC COMMENT START #${prToComment}-->`
|
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
|
// Latest commit in PR or in the branch
|
||||||
const commitSha = isPullRequest ? context.payload.pull_request.head.sha : context.sha
|
const commitSha = isPullRequest ? context.payload.pull_request.head.sha : context.sha
|
||||||
// Let users know that the comment is updated automatically
|
// Let users know that the comment is updated automatically
|
||||||
|
|||||||
Reference in New Issue
Block a user