mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
ci: preserve merge labels while state is unknown
This commit is contained in:
parent
595b709a5b
commit
2d418335a1
2 changed files with 19 additions and 11 deletions
22
.github/workflows/pr-health.yml
vendored
22
.github/workflows/pr-health.yml
vendored
|
|
@ -204,17 +204,17 @@ jobs:
|
|||
is_draft="$(jq -r '.isDraft' <<<"$data")"
|
||||
review_decision="$(jq -r '.reviewDecision // ""' <<<"$data")"
|
||||
|
||||
if [[ "$merge_state" == "BEHIND" ]]; then
|
||||
gh pr edit "$pr" --repo "$REPO" --add-label "status: needs rebase"
|
||||
else
|
||||
gh pr edit "$pr" --repo "$REPO" --remove-label "status: needs rebase" || true
|
||||
fi
|
||||
|
||||
if [[ "$merge_state" == "DIRTY" ]]; then
|
||||
gh pr edit "$pr" --repo "$REPO" --add-label "status: has conflicts"
|
||||
else
|
||||
gh pr edit "$pr" --repo "$REPO" --remove-label "status: has conflicts" || true
|
||||
fi
|
||||
if [[ "$merge_state" == "BEHIND" ]]; then
|
||||
gh pr edit "$pr" --repo "$REPO" --add-label "status: needs rebase"
|
||||
elif [[ "$merge_state" != "UNKNOWN" ]]; then
|
||||
gh pr edit "$pr" --repo "$REPO" --remove-label "status: needs rebase" || true
|
||||
fi
|
||||
|
||||
if [[ "$merge_state" == "DIRTY" ]]; then
|
||||
gh pr edit "$pr" --repo "$REPO" --add-label "status: has conflicts"
|
||||
elif [[ "$merge_state" != "UNKNOWN" ]]; then
|
||||
gh pr edit "$pr" --repo "$REPO" --remove-label "status: has conflicts" || true
|
||||
fi
|
||||
|
||||
if [[ "$check_state" == "failing" ]]; then
|
||||
gh pr edit "$pr" --repo "$REPO" --add-label "status: ci failing"
|
||||
|
|
|
|||
|
|
@ -22,3 +22,11 @@ def test_ready_for_review_label_is_removed_when_changes_are_requested() -> None:
|
|||
assert "reviewDecision" in workflow
|
||||
assert 'review_decision="$(jq -r \'.reviewDecision // ""\'' in workflow
|
||||
assert '$review_decision" == "CHANGES_REQUESTED"' in workflow
|
||||
|
||||
|
||||
def test_merge_state_unknown_does_not_clear_conflict_or_rebase_labels() -> None:
|
||||
workflow = Path(".github/workflows/pr-health.yml").read_text(encoding="utf-8")
|
||||
|
||||
assert 'elif [[ "$merge_state" != "UNKNOWN" ]]; then' in workflow
|
||||
assert 'gh pr edit "$pr" --repo "$REPO" --remove-label "status: needs rebase"' in workflow
|
||||
assert 'gh pr edit "$pr" --repo "$REPO" --remove-label "status: has conflicts"' in workflow
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue