Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/opencode-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3060,7 +3060,7 @@ jobs:
always()
&& steps.opencode_review_model_pool.outputs.review_status == 'success'
env:
GH_TOKEN: ${{ steps.opencode_app_token.outputs.token || secrets.OPENCODE_APPROVE_TOKEN || github.token }}
GH_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN || secrets.OPENCODE_APPROVE_TOKEN || steps.opencode_app_token.outputs.token || github.token }}
GH_REPOSITORY: ${{ github.event.pull_request.base.repo.full_name || github.event.inputs.target_repository || github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.inputs.pr_head_sha }}
Expand Down
13 changes: 13 additions & 0 deletions tests/test_opencode_agent_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,19 @@ def test_opencode_pending_peer_checks_hold_approval_without_failing_required_wor
assert "build_waiting_for_checks_body" not in workflow


def test_opencode_review_publication_prefers_merge_token_before_app_token():
"""Use the less-contended merge token before the OpenCode app token."""
workflow = Path(".github/workflows/opencode-review.yml").read_text(
encoding="utf-8"
)

assert (
"GH_TOKEN: ${{ secrets.PR_REVIEW_MERGE_TOKEN || "
"secrets.OPENCODE_APPROVE_TOKEN || "
"steps.opencode_app_token.outputs.token || github.token }}"
) in workflow


def test_opencode_approve_review_publication_failure_keeps_gate_result():
"""A rejected APPROVE review write is logged without losing source evidence."""
workflow = Path(".github/workflows/opencode-review.yml").read_text(
Expand Down
Loading