validate-plugins.yml 3.0 KB

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