File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Auto-Declaudeify
2+
3+ on :
4+ push :
5+ branches : ['**']
6+
7+ jobs :
8+ declaudeify :
9+ if : contains(github.event.head_commit.author.name, 'Claude') || contains(github.event.head_commit.author.email, 'claude')
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout
13+ uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0
16+
17+ - name : Check for Claude commits
18+ id : check
19+ run : |
20+ CLAUDE_COMMITS=$(git log --all --author="Claude" --oneline | wc -l)
21+ echo "count=$CLAUDE_COMMITS" >> $GITHUB_OUTPUT
22+ if [ $CLAUDE_COMMITS -gt 0 ]; then
23+ echo "Found $CLAUDE_COMMITS Claude commits, will filter"
24+ fi
25+
26+ - name : Filter Claude from history
27+ if : steps.check.outputs.count > 0
28+ run : |
29+ git filter-branch --force --env-filter \
30+ 'if [ "$GIT_AUTHOR_NAME" = "Claude" ]; then \
31+ export GIT_AUTHOR_NAME="lanmower"; \
32+ export GIT_AUTHOR_EMAIL="lanmower@lanmower.com"; \
33+ fi; \
34+ if [ "$GIT_COMMITTER_NAME" = "Claude" ]; then \
35+ export GIT_COMMITTER_NAME="lanmower"; \
36+ export GIT_COMMITTER_EMAIL="lanmower@lanmower.com"; \
37+ fi' \
38+ --tag-name-filter cat -- --all
39+
40+ - name : Force push filtered history
41+ if : steps.check.outputs.count > 0
42+ run : git push --all --force
43+ env :
44+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments