Repository navigation
108 lines (98 loc) · 4.25 KB
/
Copy pathplugin-check.yml
File metadata and controls
108 lines (98 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Plugin Check
# Installs the Claude Code plugin from this repo's marketplace with the latest
# Claude Code and fails if it does not load with every skill in skills/.
# `claude plugin validate` alone misses loader-only errors (e.g. "conflicting
# manifests"), and a new Claude Code release can start rejecting a manifest
# that loaded before — hence the weekly run on top of PRs. A failed weekly run
# opens a tracking issue (or comments on the open one), like link-check.yml.
#
# On pushes to main it also checks that a change to skills/ or .claude-plugin/
# came with a higher plugin version (scripts/plugin-version.sh check).
# dist-sync.yml bumps it on each PR, but two PRs open at once can both bump to
# the same version and merge cleanly; the second one's changes would then
# never reach installs pinned to that version. A failure opens an issue too.
on:
pull_request:
push:
branches: [main]
schedule:
# Mondays at 06:30 UTC
- cron: '30 6 * * 1'
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
plugin-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # the version check diffs the push's before..after
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Claude Code
run: npm install -g @anthropic-ai/claude-code@latest
- name: Check plugin loads
id: check
run: |
set +e
OUTPUT=$(./scripts/check-plugin.sh 2>&1)
STATUS=$?
echo "$OUTPUT"
{
echo 'output<<CHECK_PLUGIN_EOF'
echo "$OUTPUT" | tail -n 60
echo 'CHECK_PLUGIN_EOF'
} >> "$GITHUB_OUTPUT"
exit $STATUS
- name: Open or update tracking issue
if: failure() && steps.check.outcome == 'failure' && github.event_name == 'schedule'
env:
GH_TOKEN: ${{ github.token }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
CHECK_OUTPUT: ${{ steps.check.outputs.output }}
run: |
TITLE="Weekly plugin check: Claude Code fails to load the plugin"
BODY=$(printf 'The scheduled plugin check failed.\n\nRun: %s\n\n```\n%s\n```\n' "$RUN_URL" "$CHECK_OUTPUT")
EXISTING=$(gh issue list --state open --search "$TITLE in:title" --json number --jq '.[0].number // empty')
if [ -n "$EXISTING" ]; then
gh issue comment "$EXISTING" --body "$BODY"
else
gh issue create --title "$TITLE" --body "$BODY"
fi
- name: Check the plugin version moved with its content
id: version
if: ${{ !cancelled() && github.event_name == 'push' && github.event.before != '0000000000000000000000000000000000000000' }}
env:
BEFORE: ${{ github.event.before }}
AFTER: ${{ github.event.after }}
run: |
set +e
OUTPUT=$(./scripts/plugin-version.sh check "$BEFORE" "$AFTER" 2>&1)
STATUS=$?
echo "$OUTPUT"
{
echo 'output<<PLUGIN_VERSION_EOF'
echo "$OUTPUT"
echo 'PLUGIN_VERSION_EOF'
} >> "$GITHUB_OUTPUT"
exit $STATUS
- name: Open or update the version tracking issue
if: ${{ !cancelled() && steps.version.outcome == 'failure' }}
env:
GH_TOKEN: ${{ github.token }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
CHECK_OUTPUT: ${{ steps.version.outputs.output }}
run: |
TITLE="Plugin content changed on main without a version bump"
BODY=$(printf 'A push to main changed skills/ or .claude-plugin/ without raising the plugin version, so installs pinned to that version will not receive it. Open a PR that bumps "version" in .claude-plugin/plugin.json.\n\nRun: %s\n\n```\n%s\n```\n' "$RUN_URL" "$CHECK_OUTPUT")
EXISTING=$(gh issue list --state open --search "$TITLE in:title" --json number --jq '.[0].number // empty')
if [ -n "$EXISTING" ]; then
gh issue comment "$EXISTING" --body "$BODY"
else
gh issue create --title "$TITLE" --body "$BODY"
fi