bugfix: fix multi-cta top-k implementation when k value is different for different row #238
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: Claude Code | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| issues: | |
| types: [opened, assigned] | |
| pull_request_review: | |
| types: [submitted] | |
| jobs: | |
| claude: | |
| if: | | |
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || | |
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || | |
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || | |
| (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| issues: read | |
| id-token: write | |
| actions: read # Required for Claude to read CI results on PRs | |
| steps: | |
| - name: Check team membership | |
| id: check-permission | |
| env: | |
| # GITHUB_TOKEN cannot access org team membership API (HTTP 403) | |
| # Use a PAT with read:org scope stored as FLASHINFER_GITHUB_TOKEN secret | |
| GH_TOKEN: ${{ secrets.FLASHINFER_GITHUB_TOKEN }} | |
| ORG: ${{ github.repository_owner }} | |
| TEAM: agent-users | |
| shell: bash | |
| run: | | |
| # Get the username based on the event type | |
| if [[ "${{ github.event_name }}" == "issue_comment" ]] || [[ "${{ github.event_name }}" == "pull_request_review_comment" ]]; then | |
| ACTOR="${{ github.event.comment.user.login }}" | |
| elif [[ "${{ github.event_name }}" == "pull_request_review" ]]; then | |
| ACTOR="${{ github.event.review.user.login }}" | |
| elif [[ "${{ github.event_name }}" == "issues" ]]; then | |
| ACTOR="${{ github.event.issue.user.login }}" | |
| else | |
| ACTOR="${{ github.actor }}" | |
| fi | |
| echo "Checking if $ACTOR is a member of $ORG/$TEAM team..." | |
| # Verify token is set | |
| if [[ -z "$GH_TOKEN" ]]; then | |
| echo "❌ Error: FLASHINFER_GITHUB_TOKEN secret is not set" | |
| echo "authorized=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| # List team members and check if PR author is in the list | |
| MEMBERS=$(gh api \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| --paginate \ | |
| "/orgs/${ORG}/teams/${TEAM}/members" \ | |
| --jq '.[].login' 2>&1) || { | |
| echo "❌ Error calling GitHub API: $MEMBERS" | |
| echo "authorized=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| } | |
| if echo "$MEMBERS" | grep -qx "$ACTOR"; then | |
| echo "✅ $ACTOR is a member of $TEAM" | |
| echo "authorized=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "❌ $ACTOR is not a member of $TEAM" | |
| echo "authorized=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Checkout repository | |
| if: steps.check-permission.outputs.authorized == 'true' | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Run Claude Code | |
| if: steps.check-permission.outputs.authorized == 'true' | |
| id: claude | |
| uses: anthropics/claude-code-action@v1 | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| # This is an optional setting that allows Claude to read CI results on PRs | |
| additional_permissions: | | |
| actions: read | |
| # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it. | |
| # prompt: 'Update the pull request description to include a summary of changes.' | |
| # Optional: Add claude_args to customize behavior and configuration | |
| # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md | |
| # or https://code.claude.com/docs/en/cli-reference for available options | |
| # claude_args: '--allowed-tools Bash(gh pr:*)' |