Skip to content

Commit 743f628

Browse files
Support tagging Claude coauthor (#752)
* Support tagging Claude coauthor * Update docs/downloads/automation-library/integrations/claude_code/label_claude_code_by_co_author.cm Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com> * fix image --------- Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com>
1 parent f38fd04 commit 743f628

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

docs/automations/integrations/claude-code/flag-claude-code-pr/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,31 @@ starter_kits: [genai]
88
<!-- --8<-- [start:example]-->
99
Automatically apply labels to PRs that are assisted by Claude Code. You can apply labels based on a known list of Claude Code users, PR tags, or by prompting the PR author to indicate if they used Claude Code.
1010

11+
=== "Label Co-author"
12+
Automatically apply labels to PRs that are authored by Claude or have Claude as a co-author in commit messages.
13+
14+
![Label Claude Code by Co-author](/automations/integrations/claude-code/flag-claude-code-pr/label-claude-code-by-coauthor.png)
15+
16+
!!! info "Configuration Description"
17+
Conditions:
18+
19+
* The PR author's name contains "Claude" (case-insensitive), OR
20+
* Any commit message in the PR contains a "Co-Authored-By" line with Claude
21+
22+
Automation Actions:
23+
24+
* Apply a `🤖 Claude Code` label to the PR
25+
26+
!!! example "Label Claude Code by Co-author"
27+
```yaml+jinja
28+
--8<-- "docs/downloads/automation-library/integrations/claude_code/label_claude_code_by_co_author.cm"
29+
```
30+
<div class="result" markdown>
31+
<span>
32+
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/claude_code/label_claude_code_by_co_author.cm){ .md-button }
33+
</span>
34+
</div>
35+
1136
=== "Label by Prompt"
1237
Prompt PR authors to indicate if they used Claude Code for the PR and automatically label the PR if they did. This requires two separate automation files to handle posting the prompt and labeling accordingly.
1338

@@ -103,4 +128,4 @@ By labeling PRs assisted by Claude Code, you can measure:
103128
- PR risk (via Refactor Rate, CFR)
104129
- Productivity lift from AI tools
105130

106-
<!-- --8<-- [end:example]-->
131+
<!-- --8<-- [end:example]-->
47.9 KB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
manifest:
2+
version: 1.0
3+
4+
automations:
5+
tag_claude_pr:
6+
if:
7+
- {{ is.claude_author or is.claude_co_author }}
8+
run:
9+
- action: add-label@v1
10+
args:
11+
label: "🤖 Claude Code"
12+
13+
is:
14+
claude_author: {{ pr.author | lower | includes(regex=r/claude/) }}
15+
claude_co_author: {{ branch.commits.messages | match(regex=r/[Cc]o-[Aa]uthored-[Bb]y:.*[Cc]laude/) | some }}

0 commit comments

Comments
 (0)