forked from UiPath/uipath-python
-
Notifications
You must be signed in to change notification settings - Fork 0
20 lines (17 loc) · 1.1 KB
/
slack.yml
File metadata and controls
20 lines (17 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
name: GitHub Reviewer Slack Agent
on:
pull_request:
types: [opened]
jobs:
trigger-uipath-agent:
runs-on: ubuntu-latest
steps:
- name: Install Python dependencies
run: pip install requests
- name: Trigger UiPath Agent
env:
PR_NUMBER: ${{ github.event.number }}
REPO_NAME: ${{ github.repository }}
OWNER_NAME: ${{ github.repository_owner }}
run: |
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_SLACK_URL }}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs', headers={'Authorization': 'Bearer ${{ secrets.UIPATH_SLACK_PAT }}', '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}')"