Review feedback sentinel #119
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Review feedback sentinel | |
| on: | |
| schedule: | |
| - cron: "17 */6 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| since_hours: | |
| description: "Merged PR lookback window" | |
| required: false | |
| default: "72" | |
| min_severity: | |
| description: "Minimum severity to report" | |
| required: false | |
| default: "high" | |
| pr_limit: | |
| description: "Maximum merged PRs to inspect" | |
| required: false | |
| default: "100" | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: read | |
| jobs: | |
| sweep: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| env: | |
| GH_TOKEN: ${{ secrets.EVALOPS_REVIEW_GUARD_TOKEN || secrets.EVALOPS_ORG_READ_TOKEN }} | |
| SINCE_HOURS: ${{ inputs.since_hours || '72' }} | |
| MIN_SEVERITY: ${{ inputs.min_severity || 'high' }} | |
| PR_LIMIT: ${{ inputs.pr_limit || '100' }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Require org review guard token | |
| run: | | |
| if [ -z "${GH_TOKEN}" ]; then | |
| echo "::error::Set secrets.EVALOPS_REVIEW_GUARD_TOKEN or secrets.EVALOPS_ORG_READ_TOKEN with org-wide PR read access before running the review feedback sentinel." | |
| exit 2 | |
| fi | |
| - name: Sweep recent merged PR feedback | |
| id: sweep | |
| run: | | |
| set +e | |
| ruby .github/scripts/sweep-recent-review-feedback.rb \ | |
| --owner evalops \ | |
| --since-hours "${SINCE_HOURS}" \ | |
| --pr-limit "${PR_LIMIT}" \ | |
| --min-severity "${MIN_SEVERITY}" \ | |
| --issue-repo evalops/.github \ | |
| --json-output review-feedback-ledger.json \ | |
| --guardrail-backlog-output review-feedback-guardrail-backlog.md \ | |
| --guardrail-backlog-json-output review-feedback-guardrail-backlog.json \ | |
| --guardrail-issue-repo evalops/.github \ | |
| --guardrail-repo-issues \ | |
| --guardrail-lifecycle-json-output review-feedback-guardrail-lifecycle.json \ | |
| > review-feedback-sentinel.md | |
| status=$? | |
| cat review-feedback-sentinel.md >> "${GITHUB_STEP_SUMMARY}" | |
| { | |
| echo "" | |
| cat review-feedback-guardrail-backlog.md | |
| } >> "${GITHUB_STEP_SUMMARY}" | |
| if [ "${status}" -eq 0 ]; then | |
| exit 0 | |
| fi | |
| if [ "${status}" -eq 1 ]; then | |
| echo "::warning::recent unresolved review feedback found; issue was updated" | |
| exit 0 | |
| fi | |
| exit "${status}" | |
| - name: Upload review feedback ledger | |
| if: ${{ always() && steps.sweep.outcome != 'skipped' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: review-feedback-ledger | |
| path: review-feedback-ledger.json | |
| if-no-files-found: error | |
| retention-days: 30 | |
| - name: Upload review feedback guardrail backlog | |
| if: ${{ always() && steps.sweep.outcome != 'skipped' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: review-feedback-guardrail-backlog | |
| path: | | |
| review-feedback-guardrail-backlog.md | |
| review-feedback-guardrail-backlog.json | |
| review-feedback-guardrail-lifecycle.json | |
| if-no-files-found: error | |
| retention-days: 30 |