mirror of
https://github.com/stan220/flathub.git
synced 2026-09-08 17:28:57 +00:00
pr-check: Use the success status of the latest build
This commit is contained in:
@@ -141,6 +141,14 @@ jobs:
|
|||||||
gh pr view $PR_NUM --json isDraft --jq '.isDraft' | grep -q false && \
|
gh pr view $PR_NUM --json isDraft --jq '.isDraft' | grep -q false && \
|
||||||
gh pr edit $PR_NUM --remove-label "work-in-progress" >/dev/null 2>&1 || true
|
gh pr edit $PR_NUM --remove-label "work-in-progress" >/dev/null 2>&1 || true
|
||||||
|
|
||||||
|
|
||||||
|
latest_build_succeeded() {
|
||||||
|
printf '%s\n' "$PR_COMMENTS" \
|
||||||
|
| grep 'Test build' \
|
||||||
|
| tail -n 1 \
|
||||||
|
| grep -Fq "$BUILD_SUCCESS_COMMENT"
|
||||||
|
}
|
||||||
|
|
||||||
comment_exists() {
|
comment_exists() {
|
||||||
local comment="$1"
|
local comment="$1"
|
||||||
echo "$PR_COMMENTS" | grep -Fq "$comment"
|
echo "$PR_COMMENTS" | grep -Fq "$comment"
|
||||||
@@ -175,12 +183,13 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_build() {
|
start_build() {
|
||||||
if ! label_exists_any "pr-check-blocked" "blocked"; then
|
if ! label_exists_any "pr-check-blocked" "blocked" \
|
||||||
if ! comment_exists_any "$BUILD_START_COMMENT_PARTIAL" "$BUILD_SUCCESS_COMMENT"; then
|
&& ! comment_exists_any "$BUILD_START_COMMENT_PARTIAL" \
|
||||||
echo "PR is not marked as blocked and none of the build comments exist. Starting a build"
|
&& ! latest_build_succeeded
|
||||||
|
then
|
||||||
|
echo "PR is not blocked and no active or successful build exists. Starting a build"
|
||||||
gh pr comment "$PR_NUM" --body "$BUILD_START_COMMENT" >/dev/null 2>&1 || true
|
gh pr comment "$PR_NUM" --body "$BUILD_START_COMMENT" >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "${CONTAINS_MASTER:-false}" = "true" ]; then
|
if [ "${CONTAINS_MASTER:-false}" = "true" ]; then
|
||||||
@@ -303,7 +312,7 @@ jobs:
|
|||||||
"work-in-progress" \
|
"work-in-progress" \
|
||||||
"pr-check-blocked" \
|
"pr-check-blocked" \
|
||||||
"blocked" \
|
"blocked" \
|
||||||
&& if ! comment_exists_any "$BUILD_SUCCESS_COMMENT" \
|
&& ! latest_build_succeeded \
|
||||||
&& [ "$PR_THREAD_COUNT" -eq 0 ]; then
|
&& [ "$PR_THREAD_COUNT" -eq 0 ]; then
|
||||||
echo "No review comments, ensuring awaiting-review label"
|
echo "No review comments, ensuring awaiting-review label"
|
||||||
gh pr edit "$PR_NUM" \
|
gh pr edit "$PR_NUM" \
|
||||||
|
|||||||
Reference in New Issue
Block a user