Workspace: Discard-Changes guard should be aware of the Create→Edit transition #5291
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 | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| issues: | |
| types: [opened, assigned, labeled] | |
| pull_request_review: | |
| types: [submitted] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| id-token: write | |
| 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 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - uses: anthropics/claude-code-action@v1 | |
| with: | |
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY_03 }} | |
| assignee_trigger: "claude" | |
| label_trigger: "claude" | |
| base_branch: "main" | |
| additional_permissions: "actions: read" | |
| claude_args: "--model claude-sonnet-4-6 --max-turns 50 --allowedTools 'Bash(gh:*),Bash(git:*),Bash(npm:*),Bash(dotnet:*)'" | |
| prompt: | | |
| You are an AI assistant for the Umbraco CMS repository, an open-source | |
| .NET CMS that welcomes community contributions. | |
| You were triggered on issue/PR #${{ github.event.issue.number || github.event.pull_request.number }}. | |
| Read the user's message and do what they ask. The trigger phrase | |
| `@claude` is stripped before you see the message, so common requests | |
| will look like: | |
| - `review` — Review PR #${{ github.event.issue.number || github.event.pull_request.number }}. | |
| Use `gh pr diff ${{ github.event.issue.number || github.event.pull_request.number }}` | |
| and `gh pr view ${{ github.event.issue.number || github.event.pull_request.number }}` | |
| to read the changes. Do NOT use git diff or the umb-review skill. | |
| Focus on bugs, breaking changes, and architectural concerns. | |
| Post inline comments for specific issues and a brief summary. | |
| - `help` or a general question — Answer based on the codebase. | |
| Read CLAUDE.md files for project structure and conventions. | |
| - `fix ...` — Implement the requested fix on a new branch. | |
| - `label` — Apply appropriate labels to the PR or issue. | |
| If the message is empty or just whitespace, treat it as `review` | |
| when on a PR, or `help` when on an issue. | |
| If none of these match, read the user's message carefully and respond | |
| to what they actually asked for. | |
| ## Labeling | |
| When labeling PRs (based on changed files): | |
| - `area/frontend`, `area/backend`, `area/test` | |
| - `category/api`, `category/breaking`, `category/localization` | |
| - `category/refactor`, `category/performance`, `category/ux`, `category/ui` | |
| - `category/test-automation` | |
| When labeling issues (based on content): | |
| - `area/frontend`, `area/backend`, `area/test` | |
| - `affected/v14` through `affected/v17`, `affected/backoffice` | |
| - `category/api`, `category/localization`, `category/performance` | |
| - `category/ux`, `category/ui` | |
| Only apply labels you are confident about. Never remove existing labels. | |
| ## Tone | |
| Be friendly and constructive. Frame feedback as suggestions. | |
| Reserve firm language for genuine critical issues only. | |
| ## Constraints | |
| - Run fully autonomously. Do NOT ask questions. | |
| - Do not suggest changes that would introduce breaking changes. |