forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (45 loc) · 1.68 KB
/
handle-new-external-pr.yml
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
name: Handle New External PRs
on:
pull_request_target:
types: [opened]
permissions:
contents: read
jobs:
handle_new_external_pr:
runs-on: ubuntu-latest
if: github.repository == 'demisto/content' && github.event.action == 'opened' && github.event.pull_request.head.repo.fork == true && contains(github.head_ref, 'xsoar-bot-contrib-ContributionTestPack') == false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Print Context
run: |
echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv==2021.5.29
- name: Update External PR
env:
CONTENTBOT_GH_ADMIN_TOKEN: ${{ secrets.CONTENTBOT_GH_ADMIN_TOKEN }}
EVENT_PAYLOAD: ${{ toJson(github.event) }}
run: |
echo "Updating External PR ${{ github.event.pull_request.html_url }}"
cd Utils/github_workflow_scripts
pipenv sync
pipenv run ./handle_external_pr.py
echo "Finished Handling External PR"
- name: Send Notification
env:
CONTENTBOT_GH_ADMIN_TOKEN: ${{ secrets.CONTENTBOT_GH_ADMIN_TOKEN }}
EVENT_PAYLOAD: ${{ toJson(github.event) }}
CORTEX_XSOAR_SLACK_TOKEN: ${{ secrets.CORTEX_XSOAR_SLACK_TOKEN }}
run: |
echo "Sending notification about External PR ${{ github.event.pull_request.html_url }}"
cd Utils/github_workflow_scripts
pipenv run ./send_slack_message.py