feat(remixer): enhance path handling by introducing pathNumber array … #111
Workflow file for this run
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: Codex Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| concurrency: | |
| group: codex-review-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| codex: | |
| runs-on: ubuntu-latest | |
| # Only run for same-repo (non-fork) PRs by users with write access | |
| if: >- | |
| github.event.pull_request.head.repo.full_name == github.repository && | |
| contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) | |
| permissions: | |
| contents: read | |
| outputs: | |
| final_message: ${{ steps.run_codex.outputs.final-message }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| persist-credentials: false | |
| - name: Pre-fetch base and head refs for the PR | |
| env: | |
| PR_BASE_REF: ${{ github.event.pull_request.base.ref }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| # Pass GitHub expressions through env and quote shell expansions. | |
| git fetch --no-tags origin \ | |
| "$PR_BASE_REF" \ | |
| "+refs/pull/$PR_NUMBER/head" | |
| - name: Run Codex | |
| id: run_codex | |
| uses: openai/codex-action@52fe01ec70a42f454c9d2ebd47598f9fd6893d56 # v1.11.0 | |
| with: | |
| openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
| permission-profile: ":read-only" | |
| prompt: | | |
| This is PR #${{ github.event.pull_request.number }} for ${{ github.repository }}. | |
| Review ONLY the changes introduced by the PR, so consider: | |
| git log --oneline ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} | |
| Suggest any improvements, potential bugs, or issues. | |
| Be concise and specific in your feedback. | |
| For each finding, begin the line with a bolded severity in the form | |
| **Severity: <level>** — where <level> is Critical, High, Medium, or | |
| Low — judged by potential impact and relevance to the changes made. | |
| post_feedback: | |
| runs-on: ubuntu-latest | |
| needs: codex | |
| if: needs.codex.outputs.final_message != '' | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Report Codex feedback | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| CODEX_FINAL_MESSAGE: ${{ needs.codex.outputs.final_message }} | |
| with: | |
| github-token: ${{ github.token }} | |
| script: | | |
| const marker = '<!-- codex-review -->'; | |
| const body = `${marker}\n${process.env.CODEX_FINAL_MESSAGE}`; | |
| const { owner, repo } = context.repo; | |
| const issue_number = context.payload.pull_request.number; | |
| const existing = await github.paginate(github.rest.issues.listComments, { | |
| owner, | |
| repo, | |
| issue_number, | |
| }); | |
| const previous = existing.find( | |
| (c) => c.user?.login === 'github-actions[bot]' && c.body?.startsWith(marker), | |
| ); | |
| if (previous) { | |
| await github.rest.issues.updateComment({ owner, repo, comment_id: previous.id, body }); | |
| } else { | |
| await github.rest.issues.createComment({ owner, repo, issue_number, body }); | |
| } |