Repository navigation
113 lines (96 loc) · 3.25 KB
/
Copy pathupdate-agents.yml
File metadata and controls
113 lines (96 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Workflow to check AGENTS.md directory structure
# Runs daily and creates an issue if changes are detected
name: Update AGENTS.md
on:
pull_request:
branches: [ master, main ]
paths:
- 'AGENTS.md'
- '.agents/**'
- '.github/agents/**'
- '.github/copilot-instructions.md'
- '.github/aw/**'
- '.github/instructions/**'
- '.github/scripts/update_agents_structure.py'
- '.github/workflows/**'
- 'tools/**'
- 'ddns/**'
- 'schema/**'
- 'docs/**'
schedule:
# Run daily at 00:00 UTC
- cron: '0 0 * * *'
workflow_dispatch:
# Allow manual triggering
permissions:
contents: read
# Prevent concurrent runs
concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.head.label || github.ref }}"
cancel-in-progress: true
jobs:
contracts:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Run tooling contract tests
run: python3 -m unittest discover tools/tests -p "test_*.py" -v
- name: Run portable agent structure contract
run: python3 .github/scripts/update_agents_structure.py --check
- name: Run provider parity contract
run: python3 tools/check.py --providers
report-structure-drift:
if: github.event_name != 'pull_request'
permissions:
contents: read
issues: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Run portable agent structure contract
run: python3 .github/scripts/update_agents_structure.py
- name: Check for existing issue
if: always() && 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: always() && 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 }}
- name: Run tooling contract tests
if: always()
run: python3 -m unittest discover tools/tests -p "test_*.py" -v
- name: Run provider parity contract
if: always()
run: python3 tools/check.py --providers