validate-frontmatter.yml 979 B

12345678910111213141516171819202122232425262728293031323334
  1. name: Validate Frontmatter
  2. on:
  3. pull_request:
  4. paths:
  5. - '**/agents/*.md'
  6. - '**/skills/*/SKILL.md'
  7. - '**/commands/*.md'
  8. jobs:
  9. validate:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v4
  13. - uses: oven-sh/setup-bun@v2
  14. - name: Install dependencies
  15. run: cd .github/scripts && bun install yaml
  16. - name: Get changed frontmatter files
  17. id: changed
  18. run: |
  19. FILES=$(gh pr diff ${{ github.event.pull_request.number }} --name-only | grep -E '(agents/.*\.md|skills/.*/SKILL\.md|commands/.*\.md)$' || true)
  20. echo "files<<EOF" >> "$GITHUB_OUTPUT"
  21. echo "$FILES" >> "$GITHUB_OUTPUT"
  22. echo "EOF" >> "$GITHUB_OUTPUT"
  23. env:
  24. GH_TOKEN: ${{ github.token }}
  25. - name: Validate frontmatter
  26. if: steps.changed.outputs.files != ''
  27. run: |
  28. echo "${{ steps.changed.outputs.files }}" | xargs bun .github/scripts/validate-frontmatter.ts