fix: prevent text logo image auto-scaling #26
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: ai-code-review | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| push: | |
| branches: | |
| - "**" | |
| tags: [] | |
| jobs: | |
| review_pr: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| outputs: | |
| final_message: ${{ steps.run_codex.outputs.final-message }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: refs/pull/${{ github.event.pull_request.number }}/merge | |
| fetch-depth: 0 | |
| - name: Pre-fetch base and head refs for the PR | |
| run: | | |
| git fetch --no-tags origin \ | |
| ${{ github.event.pull_request.base.ref }} \ | |
| +refs/pull/${{ github.event.pull_request.number }}/head | |
| - name: Run Codex | |
| id: run_codex | |
| uses: openai/codex-action@v1 | |
| with: | |
| openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
| responses-api-endpoint: ${{ secrets.RESPONSES_API_ENDPOINT }} | |
| prompt: | | |
| This is PR #${{ github.event.pull_request.number }} for ${{ github.repository }}. | |
| Review ONLY the changes introduced by the PR: | |
| git log --oneline ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} | |
| Pull request title and body: | |
| ---- | |
| ${{ github.event.pull_request.title }} | |
| ${{ github.event.pull_request.body }} | |
| Provide concise, actionable feedback with file references when possible. Return the feedback in markdown format and Chinese. | |
| - name: Report Codex feedback | |
| if: steps.run_codex.outputs.final-message != '' | |
| uses: actions/github-script@v7 | |
| env: | |
| CODEX_FINAL_MESSAGE: ${{ steps.run_codex.outputs.final-message }} | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.payload.pull_request.number, | |
| body: process.env.CODEX_FINAL_MESSAGE, | |
| }); | |
| review_commits: | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| commit: ${{ fromJson(toJson(github.event.commits)) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ matrix.commit.id }} | |
| fetch-depth: 0 | |
| - name: Run Codex | |
| id: run_codex | |
| uses: openai/codex-action@v1 | |
| with: | |
| openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
| responses-api-endpoint: ${{ secrets.RESPONSES_API_ENDPOINT }} | |
| prompt: | | |
| This is commit ${{ matrix.commit.id }} pushed to ${{ github.repository }}. | |
| Commit message: | |
| ${{ matrix.commit.message }} | |
| Review ONLY the changes in this commit: | |
| git show ${{ matrix.commit.id }} | |
| Flag bugs, regressions, missing tests, or quality issues; keep feedback concise, specific, and actionable.Return the feedback in markdown format and Chinese. | |
| - name: Comment on commit | |
| if: steps.run_codex.outputs.final-message != '' | |
| uses: actions/github-script@v7 | |
| env: | |
| CODEX_FINAL_MESSAGE: ${{ steps.run_codex.outputs.final-message }} | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| await github.rest.repos.createCommitComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| commit_sha: '${{ matrix.commit.id }}', | |
| body: process.env.CODEX_FINAL_MESSAGE, | |
| }); |