validate-plugins.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. name: Validate Plugins
  2. on:
  3. pull_request:
  4. paths:
  5. - '.claude-plugin/**'
  6. - '*/.claude-plugin/**'
  7. - '*/agents/**'
  8. - '*/skills/**'
  9. - '*/commands/**'
  10. # Vendored plugins live TWO levels deep (plugins/<name>/, external_plugins/<name>/),
  11. # and `*` doesn't cross a `/` — so the one-level patterns above never match them.
  12. # Without these, a PR touching only e.g. plugins/<name>/.claude-plugin/plugin.json
  13. # (a manifest version bump) fires nothing and the required `validate` check sits
  14. # "Expected — Waiting for status to be reported" forever (PR #5416 hit this; same
  15. # per-level spell-out as the README/assets entries below).
  16. - 'plugins/*/.claude-plugin/**'
  17. - 'plugins/*/agents/**'
  18. - 'plugins/*/skills/**'
  19. - 'plugins/*/commands/**'
  20. - 'external_plugins/*/.claude-plugin/**'
  21. - 'external_plugins/*/agents/**'
  22. - 'external_plugins/*/skills/**'
  23. - 'external_plugins/*/commands/**'
  24. # `validate` is a required status check, so a PR that touches ONLY workflow
  25. # files (e.g. an action-SHA re-pin) would otherwise never trigger validate
  26. # and sit "Expected — Waiting for status to be reported" forever (workflow_dispatch
  27. # check runs aren't associated with the PR, so they don't satisfy it). Run
  28. # validate on workflow changes too so those PRs can clear the gate in-context.
  29. - '.github/workflows/**'
  30. # Same rationale for the scan policy prompt: a policy-only PR (.github/policy/**)
  31. # touches none of the plugin paths above, so validate would never trigger via
  32. # pull_request and the required check would sit "Expected" forever (a dispatch
  33. # check run isn't associated with the PR, so it can't satisfy the gate either).
  34. - '.github/policy/**'
  35. # Same again for the bump-tracking ledger: a PR that only edits
  36. # .github/bump-tracking.json (e.g. enrolling slugs in releases-only
  37. # tracking) matches nothing above, so the required check sits
  38. # "Expected" forever and even a dispatched validate run on the PR
  39. # head can't satisfy the gate (it only counts pull_request suites).
  40. - '.github/bump-tracking.json'
  41. # And once more for a plugin's own docs: a PR that only edits a README or
  42. # adds a screenshot matches nothing above, so the required check never
  43. # reports and the PR can't be merged. Spelled out per level because `*`
  44. # doesn't cross a `/` — plugins live at plugins/<name>/, so `*/README.md`
  45. # would not match one.
  46. - 'plugins/*/README.md'
  47. - 'plugins/*/assets/**'
  48. - 'external_plugins/*/README.md'
  49. - 'external_plugins/*/assets/**'
  50. # And for a vendored plugin's MCP server config / hooks: a PR that only edits
  51. # plugins/<name>/.mcp.json (e.g. repointing a partner's remote MCP URL, as
  52. # #4985 and its follow-up did for context7) or a hooks file matches nothing
  53. # above, so `validate` never reports and the PR sits "Expected" forever.
  54. - 'plugins/*/.mcp.json'
  55. - 'plugins/*/hooks/**'
  56. - 'external_plugins/*/.mcp.json'
  57. - 'external_plugins/*/hooks/**'
  58. push:
  59. branches: [main]
  60. paths:
  61. - '.claude-plugin/**'
  62. # `validate` is a required status check on main. Bump PRs are opened with
  63. # GITHUB_TOKEN, which doesn't fire on:pull_request (recursion guard), so the
  64. # path-filtered trigger above never reports on them and the PR would be
  65. # blocked forever. The bump workflow dispatches this against each per-entry
  66. # bump branch instead; the check run lands on the branch HEAD (= PR head)
  67. # and satisfies the required check. The validate job runs unconditionally,
  68. # so a dispatch always reports.
  69. workflow_dispatch:
  70. permissions:
  71. contents: read
  72. jobs:
  73. validate:
  74. runs-on: ubuntu-latest
  75. steps:
  76. - uses: actions/checkout@v4
  77. with:
  78. fetch-depth: 0
  79. - uses: anthropics/claude-plugins-community/.github/actions/validate-plugins@426e469f322952061102b286b378c0c9733a0934
  80. with:
  81. marketplace-path: .claude-plugin/marketplace.json
  82. # Official curated marketplace: SHA-pin (I5) is a HARD error.
  83. # I8/I11 are warnings until the 15 known vendored-path/name issues
  84. # are cleaned up (see PR body); tighten to "I1 I3" after.
  85. warn-invariants: "I1 I3 I8 I11"
  86. claude-cli-version: latest