chore: add docs-sync workflow to open PRs against dojoengine/book #43
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 Assistant | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| issues: | |
| types: [opened, assigned, labeled] | |
| pull_request: | |
| types: [labeled] | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| claude-response: | |
| runs-on: ubuntu-latest | |
| 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.label.name == 'test-integration') | |
| steps: | |
| - name: Get PR head ref | |
| id: get_pr_ref | |
| if: github.event.issue.pull_request | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const pr = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number | |
| }); | |
| return pr.data.head.ref; | |
| result-encoding: string | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| ref: ${{ steps.get_pr_ref.outputs.result || github.ref }} | |
| - uses: ./.github/actions/setup-dojo | |
| with: | |
| dojo-version: v1.7.2 | |
| scarb-version: 2.12.2 | |
| - uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build packages | |
| run: bun run build:packages | |
| - uses: anthropics/claude-code-action@v1 | |
| with: | |
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | |
| trigger_phrase: "@claude" | |
| label_trigger: "test-integration" | |
| claude_args: | | |
| --max-turns 30 |