Skip to content

Commit 8ac403f

Browse files
committed
🤖 add claude code workflow
1 parent 5a4a83b commit 8ac403f

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

.github/workflows/claude.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,7 @@ jobs:
3838
run: |
3939
git config --global user.name "claude[bot]"
4040
git config --global user.email "claude[bot]@users.noreply.github.com"
41-
42-
- name: Checkout branch
43-
run: |
44-
ymd=$(date +%Y%m%d)
45-
BRANCH_NAME="claude/auto-$ymd-${{ github.run_id }}"
46-
git checkout -b "$BRANCH_NAME"
47-
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
48-
49-
- name: Install uv
50-
uses: astral-sh/setup-uv@v6
51-
with:
52-
enable-cache: true
53-
54-
- name: Set up requirements
55-
run: |
56-
uv venv
57-
uv python install
58-
uv pip install -r scripts/requirements.txt
41+
echo "EVENT_KEY=$(date +ci-%y%m%d)" >> $GITHUB_ENV
5942
6043
- name: Check issue
6144
if: github.event.issue.number
@@ -66,6 +49,7 @@ jobs:
6649
echo "${{ github.event.comment.body }}"
6750
echo EOF
6851
} >> $GITHUB_ENV
52+
echo "EVENT_KEY=issue-${{ github.event.issue.number }}" >> $GITHUB_ENV
6953
7054
- name: Check pull request
7155
if: github.event.pull_request.number
@@ -76,6 +60,24 @@ jobs:
7660
echo "${{ github.event.comment.body || github.event.review.body }}"
7761
echo EOF
7862
} >> $GITHUB_ENV
63+
echo "EVENT_KEY=pull-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
64+
65+
- name: Checkout branch
66+
run: |
67+
BRANCH_NAME="claude/${{ env.EVENT_KEY }}-${{ github.run_id }}"
68+
git checkout -b "$BRANCH_NAME"
69+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
70+
71+
- name: Install uv
72+
uses: astral-sh/setup-uv@v6
73+
with:
74+
enable-cache: true
75+
76+
- name: Set up requirements
77+
run: |
78+
uv venv
79+
uv python install
80+
uv pip install -r scripts/requirements.txt
7981
8082
- uses: anthropics/claude-code-action@v1
8183
id: claude

0 commit comments

Comments
 (0)