guidelines-check.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: Guidelines Check
  2. on:
  3. pull_request:
  4. types: [opened, synchronize]
  5. jobs:
  6. check-guidelines:
  7. runs-on: ubuntu-latest
  8. permissions:
  9. contents: read
  10. pull-requests: write
  11. id-token: write
  12. steps:
  13. - name: Checkout repository
  14. uses: actions/checkout@v4
  15. with:
  16. fetch-depth: 1
  17. - name: Install opencode
  18. run: curl -fsSL https://opencode.ai/install | bash
  19. - name: Check PR guidelines compliance
  20. env:
  21. ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
  22. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  23. run: |
  24. opencode run -m anthropic/claude-sonnet-4-20250514 "A new pull request has been created: '${{ github.event.pull_request.title }}'
  25. PR description:
  26. ${{ github.event.pull_request.body }}
  27. Please check all the code changes in this pull request against the guidelines in AGENTS.md file in this repository.
  28. For each violation you find, create a file comment using the gh CLI. Use this exact format for each violation:
  29. \`\`\`bash
  30. gh pr review ${{ github.event.pull_request.number }} --comment-body 'This violates the AGENTS.md guideline: [specific rule]. Consider: [suggestion]' --file 'path/to/file.ts' --line [line_number]
  31. \`\`\`
  32. Only create comments for actual violations. If the code follows all guidelines, don't run any gh commands."