Skip to content

Commit 25c5037

Browse files
fumikitoclaude
andcommitted
tarosky/workflows のClaude系GitHub Actionsを導入
rich-taxonomy と同様に tarosky org 共通の Claude reusable workflow を追加: - claude-assistant.yml: Issue/PRコメントの @claude に応答 - claude-review.yml: CI(WordPress Plugin Test)成功後の自動PRレビュー および @claude auto-review による手動レビュー - issue-triage.yml: 週次Issueトリアージ - wp-plugin-audit.yml: 月次プラグイン監査 hamelp固有の調整: - test workflow名を "WordPress Plugin Test" に合わせて発火条件を設定 - plugin_name/slug を hamelp に - custom_focus を AI Overview/FAQ 生成のプロンプトインジェクション・ 権限チェック等のセキュリティ観点に設定 Co-authored-by: Claude <noreply@anthropic.com>
1 parent c833500 commit 25c5037

4 files changed

Lines changed: 140 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Claude Assistant
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
9+
jobs:
10+
assistant:
11+
if: "!contains(github.event.comment.body, '@claude auto-review')"
12+
uses: tarosky/workflows/.github/workflows/claude-assistant.yml@main
13+
secrets: inherit
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Claude Code PR Review
2+
3+
on:
4+
workflow_run:
5+
workflows: ["WordPress Plugin Test"]
6+
types: [completed]
7+
issue_comment:
8+
types: [created]
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
issues: write
14+
id-token: write
15+
16+
jobs:
17+
# CI 全パス後の自動レビュー(同一リポジトリのPRのみ)
18+
setup:
19+
if: |
20+
github.event_name == 'workflow_run' &&
21+
github.event.workflow_run.conclusion == 'success' &&
22+
github.event.workflow_run.event == 'pull_request' &&
23+
github.event.workflow_run.head_repository.full_name == github.repository
24+
runs-on: ubuntu-latest
25+
outputs:
26+
pr_number: ${{ steps.pr.outputs.number }}
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
- name: Get PR number
31+
id: pr
32+
run: |
33+
PR_NUMBER=$(gh pr list --head "${{ github.event.workflow_run.head_branch }}" --json number --jq '.[0].number')
34+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
35+
env:
36+
GH_TOKEN: ${{ github.token }}
37+
38+
auto-review:
39+
needs: setup
40+
if: needs.setup.outputs.pr_number != ''
41+
uses: tarosky/workflows/.github/workflows/claude-review.yml@main
42+
with:
43+
plugin_name: hamelp
44+
ci_checks: "PHPUnit (PHP 7.4/8.3 × WP latest/6.6), PHPCS, PHPStan, PHP lint, JS/CSS lint, JS unit test"
45+
pr_number: ${{ fromJSON(needs.setup.outputs.pr_number) }}
46+
head_sha: ${{ github.event.workflow_run.head_sha }}
47+
custom_focus: |
48+
- AI Overview / FAQ 生成でユーザー入力を LLM に渡す箇所のプロンプトインジェクション対策
49+
- AI の入力・出力のサニタイズとエスケープ(特にHTML出力時)
50+
- REST API エンドポイントの permission_callback / 権限チェック
51+
- 設定画面・FAQ生成処理の nonce / capability チェック
52+
- 翻訳文字列のテキストドメイン統一(i18n)
53+
secrets: inherit
54+
55+
# "@claude auto-review" で手動レビュー(メンバーのみ、PRコメントのみ)
56+
manual-setup:
57+
if: |
58+
github.event_name == 'issue_comment' &&
59+
contains(github.event.comment.body, '@claude auto-review') &&
60+
github.event.issue.pull_request &&
61+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
62+
runs-on: ubuntu-latest
63+
outputs:
64+
pr_number: ${{ steps.pr.outputs.number }}
65+
head_sha: ${{ steps.pr.outputs.head_sha }}
66+
steps:
67+
- name: Get PR info
68+
id: pr
69+
env:
70+
GH_TOKEN: ${{ github.token }}
71+
run: |
72+
PR_NUMBER=${{ github.event.issue.number }}
73+
HEAD_SHA=$(gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" --json headRefOid --jq '.headRefOid')
74+
echo "number=$PR_NUMBER" >> $GITHUB_OUTPUT
75+
echo "head_sha=$HEAD_SHA" >> $GITHUB_OUTPUT
76+
77+
manual-review:
78+
needs: manual-setup
79+
if: needs.manual-setup.outputs.pr_number != ''
80+
uses: tarosky/workflows/.github/workflows/claude-review.yml@main
81+
with:
82+
plugin_name: hamelp
83+
ci_checks: "PHPUnit (PHP 7.4/8.3 × WP latest/6.6), PHPCS, PHPStan, PHP lint, JS/CSS lint, JS unit test"
84+
pr_number: ${{ fromJSON(needs.manual-setup.outputs.pr_number) }}
85+
head_sha: ${{ needs.manual-setup.outputs.head_sha }}
86+
is_manual: true
87+
custom_focus: |
88+
- AI Overview / FAQ 生成でユーザー入力を LLM に渡す箇所のプロンプトインジェクション対策
89+
- AI の入力・出力のサニタイズとエスケープ(特にHTML出力時)
90+
- REST API エンドポイントの permission_callback / 権限チェック
91+
- 設定画面・FAQ生成処理の nonce / capability チェック
92+
- 翻訳文字列のテキストドメイン統一(i18n)
93+
secrets: inherit

.github/workflows/issue-triage.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Issue Triage
2+
3+
on:
4+
schedule:
5+
- cron: '0 1 * * 1' # 毎週月曜 01:00 UTC
6+
workflow_dispatch:
7+
inputs:
8+
days:
9+
description: "何日以内に作成されたIssueを対象にするか(デフォルト: 30)"
10+
required: false
11+
type: string
12+
default: '30'
13+
14+
jobs:
15+
triage:
16+
uses: tarosky/workflows/.github/workflows/issue-triage.yml@main
17+
with:
18+
plugin_name: hamelp
19+
days: ${{ fromJSON(inputs.days || '30') }}
20+
secrets: inherit
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: WP Plugin Audit
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 1 * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
audit:
10+
uses: tarosky/workflows/.github/workflows/plugin-audit.yml@main
11+
with:
12+
slug: hamelp
13+
language: ja
14+
secrets: inherit

0 commit comments

Comments
 (0)