Skip to content

feat(ci): run new e2e-suite in parallel with legacy tests for stability validation #554

feat(ci): run new e2e-suite in parallel with legacy tests for stability validation

feat(ci): run new e2e-suite in parallel with legacy tests for stability validation #554

Workflow file for this run

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-24.04-arm
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
filter: tree:0 # Optional, but recommended: reduce the size of the checkout with tree filtering, see https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
- uses: ./.github/actions/set-nx-shas
- uses: ./.github/actions/setup-node-and-install
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# Optional: Customize the trigger phrase (default: @claude)
# trigger_phrase: "/claude"
# Optional: Trigger when specific user is assigned to an issue
# assignee_trigger: "claude-bot"
# Optional: Configure Claude's behavior with CLI arguments
# claude_args: |
# --model claude-opus-4-1-20250805
# --max-turns 10
# --allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
# --system-prompt "Follow our coding standards. Ensure all new code has tests. Use TypeScript for new files."
claude_args: |
--allowed-tools "Bash(npx nx:*),Bash(npm run:*),Bash(npm install:*),Bash(npm ci:*),mcp__nx__*"
--mcp-config '{
"mcpServers": {
"nx": {
"type": "stdio",
"command": "npx",
"args": ["-y", "nx-mcp@latest"]
}
}
}'
--append-system-prompt '
## GitHub Actions Workflows Restriction
⚠️ **IMPORTANT**: You do not have `workflows:write` permission and cannot directly modify files in `.github/workflows/` or `.github/actions/`.
If a task requires changes to GitHub Actions workflows or actions, you have two options:
**Option 1: Provide a Git patch file**
1. Create the modified workflow/action files in a non-ignored directory (e.g., `workflow-patches/`)
2. Generate a Git patch that shows the changes needed:
- Use `git diff --no-index .github/workflows/original.yml workflow-patches/modified.yml > workflow-changes.patch`
- Or create a patch manually showing the exact changes
3. Commit the patch file to the repository
4. Push your commits
5. Post a PR comment with instructions for applying the patch, such as:
```
## GitHub Actions Changes Required
I have prepared the necessary workflow changes but cannot directly modify `.github/workflows/` due to permission restrictions.
**Please apply the patch file with these commands:**
```bash
git apply workflow-changes.patch
git add .github/workflows/
git commit -m "chore: apply workflow changes"
git push
```
Alternatively, review the patch file and apply the changes manually.
```
**Option 2: Provide detailed manual instructions**
1. Analyze what changes are needed to the workflow/action files
2. Post a detailed PR comment with step-by-step instructions for the user to make the changes manually, including:
- Exact file paths to modify
- Specific lines to change (with before/after examples)
- Complete diff or code blocks showing the changes
- Explanation of why each change is needed
**Choose the option that makes the most sense based on the scope of changes:**
- Use Option 1 (patch file) for new workflows or major restructuring
- Use Option 2 (manual instructions) for small, targeted edits to existing workflows
## Permission Denied Handling
If you encounter a permission denied or tool not allowed error, post a comment with:
Markdown code block with:
## Permission Denied
**Command:** <command>
**Intent:** <what you were trying to accomplish>
**Task:** <the specific task you were working on>
**Context:** <additional context>
'
# Optional: Advanced settings configuration
# settings: |
# {
# "env": {
# "NODE_ENV": "test"
# }
# }