-
Notifications
You must be signed in to change notification settings - Fork 45
85 lines (78 loc) · 2.99 KB
/
Copy pathskill_assets_drift.yml
File metadata and controls
85 lines (78 loc) · 2.99 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
name: skill-assets-drift
permissions:
contents: read
pull-requests: write
on:
pull_request:
paths:
- 'plugin/**'
- 'VERSION'
- 'release-please-config.json'
- '.release-please-manifest.json'
- 'mcp_server_dart/lib/src/skill_assets.g.dart'
- 'mcp_server_dart/tool/build_skill_assets.dart'
- 'tool/contracts/check_skill_assets_drift.sh'
- '.github/workflows/release_pr_sync_skills.yml'
push:
branches: [main]
jobs:
check-drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: '3.44.2'
- name: Install deps
run: cd mcp_server_dart && dart pub get
- name: Regenerate skill assets
run: dart run mcp_server_dart/tool/build_skill_assets.dart
- name: Verify no drift
id: verify
run: |
if ! git diff --exit-code mcp_server_dart/lib/src/skill_assets.g.dart; then
echo "::error::skill_assets.g.dart is out of sync with plugin/. Run 'make sync-skills' and commit the result."
exit 1
fi
- name: Comment on Release PR (drift)
if: >-
failure() && (
startsWith(github.head_ref, 'release-please--') ||
contains(github.event.pull_request.title, ': release ')
)
uses: actions/github-script@v7
env:
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/workflows/release_pr_sync_skills.yml
with:
script: |
const marker = '<!-- skill-assets-drift-failure -->';
const pr = context.payload.pull_request;
const body = `${marker}
## skill-assets-drift failed
\`skill_assets.g.dart\` is out of sync with \`plugin/\` (common after release-please bumps plugin manifests).
1. Wait for [Release PR — sync skill assets](${process.env.WORKFLOW_URL}) to push a fix commit on this branch, **or**
2. Run locally: \`make sync-skills\`, commit \`mcp_server_dart/lib/src/skill_assets.g.dart\`, and push.
Re-run the **skill-assets-drift** check after the sync commit lands.
`;
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
});
const existing = comments.find((c) => c.body?.includes(marker));
if (existing) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existing.id,
body,
});
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
body,
});
}