Skip to content

Commit 5ce28c4

Browse files
authored
Merge pull request #85 from UiPath/fix/add_slack_agent_trigger
feat: add slack agent trigger
2 parents 01afe91 + eb7d0e7 commit 5ce28c4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: GitHub Slack Agent
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
jobs:
8+
trigger-uipath-agent:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Install Python dependencies
12+
run: pip install requests
13+
14+
- name: Trigger UiPath Agent
15+
env:
16+
PR_NUMBER: ${{ github.event.number }}
17+
REPO_NAME: ${{ github.repository }}
18+
OWNER_NAME: ${{ github.repository_owner }}
19+
run: |
20+
python -c "import requests; import json; import os; comment = {'messages': [{'role': 'user', 'content': f'You are reviewing PR #{os.environ['PR_NUMBER']}, repo: {os.environ['REPO_NAME']}, owner: {os.environ['OWNER_NAME']}'}]}; payload = json.dumps(comment); resp = requests.post('${{ secrets.UIPATH_URL }}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs', headers={'Authorization': 'Bearer ${{ secrets.UIPATH_ACCESS_TOKEN }}', 'Content-Type': 'application/json', 'X-UiPath-FolderPath': 'MCP Folder'}, json={'startInfo': {'releaseName': 'github-slack-agent', 'inputArguments': payload}}); print(f'Status code: {resp.status_code}'); print(f'Response: {resp.text}')"

0 commit comments

Comments
 (0)