| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- # Workflow to check AGENTS.md directory structure
- # Runs daily and creates an issue if changes are detected
- name: Update AGENTS.md
- on:
- schedule:
- # Run daily at 00:00 UTC
- - cron: '0 0 * * *'
- workflow_dispatch:
- # Allow manual triggering
- permissions:
- contents: read
- issues: write
- # Prevent concurrent runs
- concurrency:
- group: update-agents-md
- cancel-in-progress: true
- jobs:
- check-agents:
- runs-on: ubuntu-latest
- timeout-minutes: 5
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
- with:
- fetch-depth: 1
-
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.x'
-
- - name: Run comparison script
- run: python3 .github/scripts/update_agents_structure.py
-
- - name: Check for existing issue
- if: hashFiles('.github/issue_body.md') != ''
- id: existing
- run: |
- existing_issue=$(gh issue list --label "agents-structure-update" --state open --limit 1 --json number --jq '.[0].number // empty')
- if [ -n "$existing_issue" ]; then
- echo "exists=true" >> $GITHUB_OUTPUT
- echo "issue_number=$existing_issue" >> $GITHUB_OUTPUT
- else
- echo "exists=false" >> $GITHUB_OUTPUT
- fi
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Create issue
- if: hashFiles('.github/issue_body.md') != '' && steps.existing.outputs.exists == 'false'
- run: |
- gh issue create \
- --title "docs(agents): AGENTS.md directory structure needs update" \
- --body-file .github/issue_body.md \
- --label "documentation,automated,agents-structure-update"
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|