ci: assigner: add module and issue support, enable issue

Add a scheduled entry to run_assignee to run the module assignment
function periodically, as well as a target to run the issue code when
issue labels are changed.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2023-08-15 14:40:54 +00:00 committed by Carles Cufí
parent b6cbcbaa5b
commit abb8ede0bc

View File

@ -10,6 +10,9 @@ on:
branches:
- main
- v*-branch
issues:
types:
- labeled
jobs:
assignment:
@ -21,7 +24,7 @@ jobs:
- name: Install Python dependencies
run: |
sudo pip3 install -U setuptools wheel pip
pip3 install -U PyGithub>=1.55
pip3 install -U PyGithub>=1.55 west
- name: Check out source code
uses: actions/checkout@v3
@ -30,9 +33,19 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }}
run: |
python3 scripts/set_assignees.py \
-v \
-o ${{ github.event.repository.owner.login }} \
-r ${{ github.event.repository.name }} \
-M MAINTAINERS.yml \
-P ${{ github.event.pull_request.number }}
FLAGS="-v"
FLAGS+=" -o ${{ github.event.repository.owner.login }}"
FLAGS+=" -r ${{ github.event.repository.name }}"
FLAGS+=" -M MAINTAINERS.yml"
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
FLAGS+=" -P ${{ github.event.pull_request.number }}"
elif [ "${{ github.event_name }}" = "issues" ]; then
FLAGS+=" -I ${{ github.event.issue.number }}"
elif [ "${{ github.event_name }}" = "schedule" ]; then
FLAGS+=" --modules"
else
echo "Unknown event: ${{ github.event_name }}"
exit 1
endif
python3 scripts/set_assignees.py $FLAGS