update-agents.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Workflow to check AGENTS.md directory structure
  2. # Runs daily and creates an issue if changes are detected
  3. name: Update AGENTS.md
  4. on:
  5. schedule:
  6. # Run daily at 00:00 UTC
  7. - cron: '0 0 * * *'
  8. workflow_dispatch:
  9. # Allow manual triggering
  10. permissions:
  11. contents: read
  12. issues: write
  13. # Prevent concurrent runs
  14. concurrency:
  15. group: update-agents-md
  16. cancel-in-progress: true
  17. jobs:
  18. check-agents:
  19. runs-on: ubuntu-latest
  20. timeout-minutes: 5
  21. steps:
  22. - name: Checkout repository
  23. uses: actions/checkout@v4
  24. with:
  25. fetch-depth: 1
  26. - name: Set up Python
  27. uses: actions/setup-python@v5
  28. with:
  29. python-version: '3.x'
  30. - name: Run comparison script
  31. run: python3 .github/scripts/update_agents_structure.py
  32. - name: Check for existing issue
  33. if: hashFiles('.github/issue_body.md') != ''
  34. id: existing
  35. run: |
  36. existing_issue=$(gh issue list --label "agents-structure-update" --state open --limit 1 --json number --jq '.[0].number // empty')
  37. if [ -n "$existing_issue" ]; then
  38. echo "exists=true" >> $GITHUB_OUTPUT
  39. echo "issue_number=$existing_issue" >> $GITHUB_OUTPUT
  40. else
  41. echo "exists=false" >> $GITHUB_OUTPUT
  42. fi
  43. env:
  44. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  45. - name: Create issue
  46. if: hashFiles('.github/issue_body.md') != '' && steps.existing.outputs.exists == 'false'
  47. run: |
  48. gh issue create \
  49. --title "docs(agents): AGENTS.md directory structure needs update" \
  50. --body-file .github/issue_body.md \
  51. --label "documentation,automated,agents-structure-update"
  52. env:
  53. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}