Update Storybook Dependency #19
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 Comment | |
| on: | |
| issue_comment: | |
| types: [created] | |
| concurrency: | |
| group: codex-${{ github.event.issue.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-team-member: | |
| name: Validate Codex commenter | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event.issue.pull_request && | |
| contains(github.event.comment.body, '/codex') && | |
| github.actor != 'github-actions[bot]' | |
| outputs: | |
| is-team-member: ${{ steps.check.outputs.is-member }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 1 | |
| - name: Check if actor is on OSS team | |
| id: check | |
| run: | | |
| ACTOR="${{ github.actor }}" | |
| if grep -q "@${ACTOR}" .github/teams.yml; then | |
| echo "is-member=true" >> "$GITHUB_OUTPUT" | |
| echo "✅ $ACTOR is a team member" | |
| else | |
| echo "is-member=false" >> "$GITHUB_OUTPUT" | |
| echo "❌ $ACTOR is not a team member" | |
| fi | |
| run-codex: | |
| name: Run Codex | |
| runs-on: ubuntu-latest | |
| needs: check-team-member | |
| if: | | |
| needs.check-team-member.result == 'success' && | |
| needs.check-team-member.outputs.is-team-member == 'true' | |
| permissions: | |
| contents: read | |
| outputs: | |
| final_message: ${{ steps.codex_comment.outputs.final-message || steps.codex_full_review.outputs.final-message }} | |
| steps: | |
| - name: Checkout PR merge commit | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| ref: refs/pull/${{ github.event.issue.number }}/merge | |
| - name: Fetch base and head refs | |
| run: | | |
| git fetch --no-tags origin \ | |
| ${{ github.event.issue.pull_request.base.ref }} \ | |
| +refs/pull/${{ github.event.issue.number }}/head \ | |
| +refs/pull/${{ github.event.issue.number }}/merge | |
| - name: Determine Codex mode | |
| id: mode | |
| run: | | |
| COMMENT="${{ github.event.comment.body }}" | |
| if echo "$COMMENT" | grep -qi '/codex /full-review'; then | |
| echo "mode=full-review" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "mode=comment" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Run Codex (quick reply) | |
| id: codex_comment | |
| if: steps.mode.outputs.mode == 'comment' | |
| uses: openai/codex-action@v1 | |
| with: | |
| openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
| prompt: | | |
| You are Codex assisting on pull request #${{ github.event.issue.number }} in ${{ github.repository }}. | |
| Base SHA: ${{ github.event.issue.pull_request.base.sha }} | |
| Head SHA: ${{ github.event.issue.pull_request.head.sha }} | |
| Comment from @${{ github.actor }}: | |
| ---- | |
| ${{ github.event.comment.body }} | |
| ---- | |
| Follow the instructions from the commenter and limit work to this PR's changes. Provide actionable output suitable for posting back to the PR conversation. | |
| - name: Run Codex (full review) | |
| id: codex_full_review | |
| if: steps.mode.outputs.mode == 'full-review' | |
| uses: openai/codex-action@v1 | |
| with: | |
| openai-api-key: ${{ secrets.OPENAI_API_KEY }} | |
| codex-args: --max-turns 5 --allowed-tools "mcp__github_inline_comment__create_inline_comment,Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)" | |
| prompt: | | |
| You are Codex performing a comprehensive review for the ZenML React Component Library. | |
| REPO: ${{ github.repository }} | |
| PR NUMBER: ${{ github.event.issue.number }} | |
| BASE SHA: ${{ github.event.issue.pull_request.base.sha }} | |
| HEAD SHA: ${{ github.event.issue.pull_request.head.sha }} | |
| Triggering comment from @${{ github.actor }}: | |
| ---- | |
| ${{ github.event.comment.body }} | |
| ---- | |
| Context: | |
| - Fetch PR metadata via: gh pr view ${{ github.event.issue.number }} --json title,body,author,headRefName,baseRefName,commits | |
| - Inspect the diff via: gh pr diff ${{ github.event.issue.number }} --name-only | |
| - Use repo docs (AGENTS.md, CLAUDE.md, README) for conventions. | |
| - This repo ships the @zenml-io/react-component-library built with React, TypeScript, Tailwind, and Radix primitives. | |
| Primary Review Goals: | |
| 1) Verify components and utilities behave as intended without regressions. | |
| 2) Ensure API changes are intentional, documented, and typed (no implicit `any`). | |
| 3) Enforce styling/pattern discipline: Tailwind utilities, shared tokens, no lucide-react imports. | |
| 4) Check accessibility (ARIA roles, keyboard interactions) and cross-browser resilience. | |
| 5) Flag dead code, accidental snapshots, or package/version drift. | |
| Documentation & Testing: | |
| - If public APIs change, ensure docs, stories, and typings are updated. | |
| - Request unit tests (vitest) for new utilities and visual regression coverage when warranted. | |
| - Confirm stories showcase new props/variants. | |
| Output Instructions: | |
| - Start with a brief summary of the PR's intent. | |
| - List critical issues (blocking) with file references. | |
| - Provide minor suggestions and celebrate strengths. | |
| - Suggest concrete next steps or TODOs. | |
| - Use `gh pr comment` if inline discussion is required (allowed via codex-args). | |
| post-comment: | |
| name: Post Codex reply | |
| runs-on: ubuntu-latest | |
| needs: run-codex | |
| if: always() && needs.run-codex.result == 'success' | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Debug outputs | |
| run: | | |
| echo "Final message length: ${#FINAL_MESSAGE}" | |
| echo "Issue number: ${{ github.event.issue.number }}" | |
| env: | |
| FINAL_MESSAGE: ${{ needs.run-codex.outputs.final_message }} | |
| - name: Reply with Codex output | |
| if: needs.run-codex.outputs.final_message | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const body = `${{ needs.run-codex.outputs.final_message }}`; | |
| if (!body || body.trim() === '') { | |
| core.info('No Codex output to post.'); | |
| return; | |
| } | |
| console.log('Posting comment with length:', body.length); | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: ${{ github.event.issue.number }}, | |
| body | |
| }); | |
| console.log('Comment posted successfully'); |