validate-plugins.yml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. push:
  51. branches: [main]
  52. paths:
  53. - '.claude-plugin/**'
  54. # `validate` is a required status check on main. Bump PRs are opened with
  55. # GITHUB_TOKEN, which doesn't fire on:pull_request (recursion guard), so the
  56. # path-filtered trigger above never reports on them and the PR would be
  57. # blocked forever. The bump workflow dispatches this against each per-entry
  58. # bump branch instead; the check run lands on the branch HEAD (= PR head)
  59. # and satisfies the required check. The validate job runs unconditionally,
  60. # so a dispatch always reports.
  61. workflow_dispatch:
  62. permissions:
  63. contents: read
  64. jobs:
  65. validate:
  66. runs-on: ubuntu-latest
  67. steps:
  68. - uses: actions/checkout@v4
  69. with:
  70. fetch-depth: 0
  71. - uses: anthropics/claude-plugins-community/.github/actions/validate-plugins@426e469f322952061102b286b378c0c9733a0934
  72. with:
  73. marketplace-path: .claude-plugin/marketplace.json
  74. # Official curated marketplace: SHA-pin (I5) is a HARD error.
  75. # I8/I11 are warnings until the 15 known vendored-path/name issues
  76. # are cleaned up (see PR body); tighten to "I1 I3" after.
  77. warn-invariants: "I1 I3 I8 I11"
  78. claude-cli-version: latest