## Copyright (C) 2026 - 2026 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

## AI-Assisted

## Managed by pkg_update_consumer_workflows. Byte-identical
## across consumers; this file is `cp`-ed from
## developer-meta-files/consumer-templates/.github/workflows/consumer-codex-review.yml.
## DO NOT hand-edit this file in the consumer repo - changes
## will be overwritten on the next propagation pass.
##
## Reusable docs:
## https://github.com/org-ai-assisted/developer-meta-files/blob/master/.github/workflows/reusable-codex-review.yml

name: OpenAI Codex Review

on:
  pull_request:
    branches: [master]
  workflow_dispatch:
    inputs:
      pr_ref:
        description: |
          Ref of the fork PR to review.
          Use `refs/pull/<N>/merge` (most accurate; mirrors what
          would land), or `refs/pull/<N>/head` for the PR head.
          A plain branch name in the upstream repo also works for
          non-fork PRs.
        required: true
        type: string

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  review:
    uses: org-ai-assisted/developer-meta-files/.github/workflows/reusable-codex-review.yml@master
    with:
      pr-ref: ${{ inputs.pr_ref || '' }}
    secrets:
      OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
    permissions:
      contents: read
      pull-requests: write
