Skip to content

Commit fae4e01

Browse files
feat: automate AGT marketplace snapshot
Signed-off-by: Imran Siddique <imran.siddique@opaque.co>
1 parent c06c04e commit fae4e01

5 files changed

Lines changed: 733 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Sync AGT Marketplace snapshot
2+
on:
3+
schedule:
4+
- cron: "17 7 * * *"
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
sync:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
14+
with:
15+
persist-credentials: true
16+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17+
with:
18+
repository: microsoft/agent-governance-toolkit
19+
ref: main
20+
fetch-depth: 1
21+
path: .agt-source
22+
persist-credentials: false
23+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
24+
with:
25+
python-version: "3.12"
26+
- name: Generate and verify snapshot
27+
run: |
28+
python scripts/generate_agt_marketplace_catalog.py --agt-root .agt-source
29+
python -m pytest tests/test_generate_agt_marketplace_catalog.py -q
30+
- name: Open refresh pull request
31+
env:
32+
GH_TOKEN: ${{ github.token }}
33+
run: |
34+
if git diff --quiet -- marketplace/agt-catalog.json; then
35+
echo "AGT snapshot is current"
36+
exit 0
37+
fi
38+
branch=automation/agt-marketplace-snapshot
39+
git config user.name "github-actions[bot]"
40+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
41+
git fetch origin "$branch:refs/remotes/origin/$branch" || true
42+
git switch -C "$branch"
43+
git add marketplace/agt-catalog.json
44+
git commit -s -m "chore: refresh AGT marketplace snapshot"
45+
git push --force-with-lease origin "$branch"
46+
gh pr view "$branch" >/dev/null 2>&1 || gh pr create --base main --head "$branch" --title "chore: refresh AGT marketplace snapshot" --body "Automated, commit-pinned refresh of the Microsoft AGT integration inventory. Generated from package metadata and README headings; no AGT repository change is required."

.github/workflows/validate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ jobs:
4242
run: |
4343
python -m pytest tests/test_generate_marketplace_catalog.py -q
4444
python scripts/generate_marketplace_catalog.py --check
45+
- name: Test AGT Marketplace snapshot generation
46+
run: python -m pytest tests/test_generate_agt_marketplace_catalog.py -q

0 commit comments

Comments
 (0)