Skip to content

Commit 3574f6f

Browse files
masseaterclaude
andcommitted
chore(github-workflow): sync auto-generated files
- Register suggest-actions-update hook in hooks.json - Update AGENTS.md component list - Sync marketplace.json version Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 56b42f8 commit 3574f6f

4 files changed

Lines changed: 43 additions & 14 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"name": "github-workflow",
5757
"source": "./plugins/github-workflow",
5858
"description": "Git/GitHub ワークフロー支援 — Stop 時にブランチ状態とコンフリクトを通知",
59-
"version": "0.0.7"
59+
"version": "0.0.8"
6060
},
6161
{
6262
"name": "mutils",

plugins/github-workflow/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ bun run typecheck # type check
2727
| hook | check-branch-status | Stop |
2828
| hook | check-push-pr-conflicts | PostToolUse (Bash) |
2929
| hook | log-git-status | Stop |
30-
| hook | suggest-actions-update | PostToolUse (Write\|Edit) — .github/\*.yml 変更時に古い Actions の最新バージョンを提案 |
30+
| hook | suggest-actions-update | PostToolUse (Write\|Edit) |
3131

3232
<!-- END:component-list -->

plugins/github-workflow/hooks/entry/suggest-actions-update.ts

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { HookLogger, wrapRun } from "@r_masseater/cc-plugin-lib";
33
import { defineHook, runHook } from "cc-hooks-ts";
44
import {
5+
extractActionRefs,
56
findOutdatedActions,
67
formatSuggestions,
78
isGitHubWorkflowFile,
@@ -10,6 +11,8 @@ import {
1011

1112
using logger = HookLogger.fromFile(import.meta.filename);
1213

14+
const FETCH_TIMEOUT_MS = 30_000;
15+
1316
const hook = defineHook({
1417
trigger: {
1518
PostToolUse: {
@@ -30,23 +33,40 @@ const hook = defineHook({
3033
return context.success({});
3134
}
3235

33-
const outdated = findOutdatedActions(content);
34-
if (outdated.length === 0) {
36+
const refs = extractActionRefs(content);
37+
if (refs.length === 0) {
3538
return context.success({});
3639
}
3740

38-
const additionalContext = formatSuggestions(outdated);
39-
logger.info(additionalContext);
41+
logger.info(`Found ${refs.length} action ref(s) in ${filePath}, checking for updates...`);
42+
43+
return context.defer(
44+
async () => {
45+
const outdated = await findOutdatedActions(refs);
46+
47+
if (outdated.length === 0) {
48+
logger.info("All actions are up to date.");
49+
return {
50+
event: "PostToolUse" as const,
51+
output: {},
52+
};
53+
}
54+
55+
const additionalContext = formatSuggestions(outdated);
56+
logger.info(additionalContext);
4057

41-
return context.json({
42-
event: "PostToolUse",
43-
output: {
44-
hookSpecificOutput: {
45-
hookEventName: "PostToolUse",
46-
additionalContext,
47-
},
58+
return {
59+
event: "PostToolUse" as const,
60+
output: {
61+
hookSpecificOutput: {
62+
hookEventName: "PostToolUse" as const,
63+
additionalContext,
64+
},
65+
},
66+
};
4867
},
49-
});
68+
{ timeoutMs: FETCH_TIMEOUT_MS },
69+
);
5070
}),
5171
});
5272

plugins/github-workflow/hooks/hooks.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/entry/auto-ci-watch.ts"
2525
}
2626
]
27+
},
28+
{
29+
"matcher": "Write|Edit",
30+
"hooks": [
31+
{
32+
"type": "command",
33+
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/entry/suggest-actions-update.ts"
34+
}
35+
]
2736
}
2837
],
2938
"Stop": [

0 commit comments

Comments
 (0)