feat(studio): expand fragment search to match card title and content #3650
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: 'Piñata Agent' | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| pull_request_review: | |
| types: [submitted] | |
| issues: | |
| types: [opened, assigned] | |
| jobs: | |
| pinata-agent: | |
| if: | | |
| (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@pinata-agent')) || | |
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@pinata-agent')) || | |
| (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@pinata-agent')) || | |
| (github.event_name == 'issues' && (contains(github.event.issue.body, '@pinata-agent') || contains(github.event.issue.title, '@pinata-agent'))) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| actions: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 | |
| with: | |
| app-id: ${{ secrets.PINATA_APP_ID }} | |
| private-key: ${{ secrets.PINATA_APP_PRIVATE_KEY }} | |
| - name: Run Piñata Agent | |
| id: pinata | |
| uses: anthropics/claude-code-action@88c168b39e7e64da0286d812b6e9fbebb6708185 # v1 | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| github_token: ${{ steps.app-token.outputs.token }} | |
| trigger_phrase: '@pinata-agent' | |
| bot_name: 'Piñata' | |
| additional_permissions: | | |
| actions: read | |
| - name: Resolve comment body | |
| if: ${{ !cancelled() }} | |
| id: comment-body | |
| env: | |
| COMMENT_BODY: ${{ github.event.comment.body || github.event.review.body || github.event.issue.body }} | |
| run: | | |
| DELIM="EOF_$(openssl rand -hex 8)" | |
| echo "body<<${DELIM}" >> "$GITHUB_OUTPUT" | |
| echo "$COMMENT_BODY" >> "$GITHUB_OUTPUT" | |
| echo "${DELIM}" >> "$GITHUB_OUTPUT" | |
| - name: Resolve issue/PR number | |
| if: ${{ !cancelled() }} | |
| id: number | |
| env: | |
| ISSUE_NUMBER: ${{ github.event.issue.number }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| run: | | |
| if [ -n "$ISSUE_NUMBER" ]; then | |
| echo "value=$ISSUE_NUMBER" >> "$GITHUB_OUTPUT" | |
| elif [ -n "$PR_NUMBER" ]; then | |
| echo "value=$PR_NUMBER" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Generate harness repo token | |
| if: ${{ !cancelled() }} | |
| id: harness-token | |
| uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1 | |
| with: | |
| app-id: ${{ secrets.PINATA_APP_ID }} | |
| private-key: ${{ secrets.PINATA_APP_PRIVATE_KEY }} | |
| repositories: pinata | |
| owner: adobe-acom | |
| - name: Dispatch to harness knowledge-bot | |
| if: ${{ !cancelled() }} | |
| uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3 | |
| with: | |
| token: ${{ steps.harness-token.outputs.token }} | |
| repository: adobe-acom/pinata | |
| event-type: pinata-knowledge-bot | |
| client-payload: | | |
| { | |
| "source_repo": "${{ github.repository }}", | |
| "source_repo_owner": "${{ github.repository_owner }}", | |
| "source_repo_name": "${{ github.event.repository.name }}", | |
| "event_type": "${{ github.event_name }}", | |
| "number": "${{ steps.number.outputs.value }}", | |
| "comment_body": ${{ toJSON(steps.comment-body.outputs.body) }} | |
| } |