Skip to content

Reviewer Bot Reconcile #638

Reviewer Bot Reconcile

Reviewer Bot Reconcile #638

name: Reviewer Bot Reconcile
on:
workflow_run:
workflows:
- Reviewer Bot PR Comment Router
- Reviewer Bot PR Review Submitted Observer
- Reviewer Bot PR Review Dismissed Observer
- Reviewer Bot PR Review Comment Observer
types: [completed]
permissions:
contents: read
env:
STATE_ISSUE_NUMBER: '314'
jobs:
reconcile:
runs-on: ubuntu-latest
permissions:
# Temporary lock debt: contents:write is allowed only for the existing lock-ref API operations.
contents: write
issues: write
pull-requests: write
actions: read
steps:
- name: Install uv
run: python -m pip install uv
- name: Download deferred artifact
continue-on-error: true
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
path: ${{ runner.temp }}/observer-artifact
run-id: ${{ github.event.workflow_run.id }}
repository: ${{ github.repository }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout trusted bot source
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: ${{ github.sha }}
- name: Select trusted bot source
id: bot-source
uses: ./.github/actions/reviewer-bot-source
- name: Select deferred payload
run: |
python - <<'PY'
import os
from pathlib import Path
files = sorted(Path(os.environ['RUNNER_TEMP']).joinpath('observer-artifact').rglob('*.json'))
if len(files) > 1:
raise SystemExit(f'Expected at most one deferred payload, found {len(files)}')
if len(files) == 1:
print(f'DEFERRED_CONTEXT_PATH={files[0]}', file=open(os.environ['GITHUB_ENV'], 'a', encoding='utf-8'))
PY
- name: Run trusted reconcile
env:
BOT_SRC_ROOT: ${{ steps.bot-source.outputs.bot-src-root }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT_NAME: workflow_run
EVENT_ACTION: completed
REVIEWER_BOT_WORKFLOW_KIND: reconcile
WORKFLOW_RUN_TRIGGERING_ID: ${{ github.event.workflow_run.id }}
WORKFLOW_RUN_TRIGGERING_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
WORKFLOW_RUN_TRIGGERING_CONCLUSION: ${{ github.event.workflow_run.conclusion }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
WORKFLOW_RUN_ID: ${{ github.run_id }}
WORKFLOW_NAME: ${{ github.workflow }}
WORKFLOW_JOB_NAME: ${{ github.job }}
run: uv run --project "$BOT_SRC_ROOT" reviewer-bot
- name: Workflow summary
run: |
{
echo 'Deferred-gap recovery guidance:'
echo '- docs/reviewer-bot-review-freshness-operator-runbook.md'
} >> "$GITHUB_STEP_SUMMARY"