2023-06-23 12:34:35 +00:00
|
|
|
name: run assign_tasks.py
|
|
|
|
on:
|
|
|
|
pull_request:
|
2023-06-26 10:40:56 +00:00
|
|
|
types: [opened]
|
2023-06-23 12:34:35 +00:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
issues:
|
|
|
|
types: [opened]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
permissions: write-all
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2023-07-10 23:17:32 +00:00
|
|
|
ASSIGN_TASK_TOKEN: ${{ secrets.PDTEAMX_PAT }} # github personal token
|
2023-06-23 12:34:35 +00:00
|
|
|
steps:
|
|
|
|
- name: checkout repo content
|
|
|
|
uses: actions/checkout@v2 # checkout the repository content
|
|
|
|
- name: setup python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.10' # install the python version needed
|
|
|
|
- name: install python packages
|
|
|
|
run: |
|
|
|
|
pip install requests
|
|
|
|
- name: execute python script on pr
|
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
|
|
run: python .github/scripts/assign_tasks.py ${{ github.event.pull_request.number }} pr ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: execute python script on issue opened
|
|
|
|
if: ${{ github.event_name == 'issues' }}
|
|
|
|
run: python .github/scripts/assign_tasks.py ${{ github.event.issue.number }} issue ${{ secrets.GITHUB_TOKEN }}
|