Skip to content

Commit da019d2

Browse files
committed
Add Azure Foundry agent and Teams notification skills
- Create SKILL.md and call_foundry.py for Azure Foundry agent functionality. - Implement Teams notification with SKILL.md and send_teams_notification.py. - Add GitHub Actions workflow to trigger Foundry agent on issue comments. - Remove obsolete issue_comment_logger.yml workflow. - Update requirements.txt to include the 'openai' package.
1 parent 350da0d commit da019d2

7 files changed

Lines changed: 52 additions & 20 deletions

File tree

File renamed without changes.

.claude/skills/call_foundry_agent/scripts/call_foundry.py renamed to .github/skills/call_foundry_agent/scripts/call_foundry.py

File renamed without changes.
File renamed without changes.

.claude/skills/teams_notification/scripts/send_teams_notification.py renamed to .github/skills/teams_notification/scripts/send_teams_notification.py

File renamed without changes.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Call Foundry Agent on Issue Comment
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
call_foundry_agent:
9+
if: github.actor != 'github-actions[bot]' && contains(github.event.comment.body, '@foundry')
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
issues: write
14+
pull-requests: write
15+
id-token: write
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Azure login (OIDC)
26+
uses: azure/login@v2
27+
with:
28+
client-id: ${{ vars.AZURE_CLIENT_ID }}
29+
tenant-id: ${{ vars.AZURE_TENANT_ID }}
30+
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
31+
32+
- name: Install Python dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
python -m pip install openai azure-identity azure-ai-projects==2.0.0b1 python-dotenv
36+
37+
- name: Call Foundry Agent and post response
38+
env:
39+
GITHUB_TOKEN: ${{ github.token }}
40+
AZURE_AI_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_PROJECT_ENDPOINT }}
41+
AZURE_AI_AGENT_NAME: ${{ vars.AZURE_AI_AGENT_NAME }}
42+
run: |
43+
# Remove @foundry (case-insensitive) from the comment and trim whitespace
44+
COMMENT_BODY="${{ github.event.comment.body }}"
45+
PROMPT=$(echo "$COMMENT_BODY" | sed -E 's/@[Ff][Oo][Uu][Nn][Dd][Rr][Yy]//gi' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
46+
47+
# Call the Python script and capture output (support multi-line)
48+
python .github/skills/call_foundry_agent/scripts/call_foundry.py "$PROMPT" > response.txt
49+
50+
# Post the response as an issue comment
51+
gh issue comment ${{ github.event.issue.number }} --repo "${{ github.repository }}" --body-file response.txt

.github/workflows/issue_comment_logger.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ selenium>=4.14.0
1313
webdriver-manager>=4.0.1
1414
agent-framework-azure-ai
1515
azure-identity
16+
openai
1617
azure-ai-projects>=2.0.0b1

0 commit comments

Comments
 (0)