Skip to content

Commit 124821d

Browse files
committed
assigner
Signed-off-by: Anas Nashif <[email protected]>
1 parent c4d9289 commit 124821d

File tree

2 files changed

+56
-28
lines changed

2 files changed

+56
-28
lines changed

.github/workflows/assigner.yml

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Pull Request Assigner
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types:
66
- opened
77
- synchronize
@@ -28,30 +28,44 @@ jobs:
2828
issues: write # to add assignees to issues
2929

3030
steps:
31-
- name: Install Python dependencies
32-
run: |
33-
pip install -U PyGithub>=1.55 west
34-
35-
- name: Check out source code
36-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37-
38-
- name: Run assignment script
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }}
41-
run: |
42-
FLAGS="-v"
43-
FLAGS+=" -o ${{ github.event.repository.owner.login }}"
44-
FLAGS+=" -r ${{ github.event.repository.name }}"
45-
FLAGS+=" -M MAINTAINERS.yml"
46-
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
47-
FLAGS+=" -P ${{ github.event.pull_request.number }}"
48-
elif [ "${{ github.event_name }}" = "issues" ]; then
49-
FLAGS+=" -I ${{ github.event.issue.number }}"
50-
elif [ "${{ github.event_name }}" = "schedule" ]; then
51-
FLAGS+=" --modules"
52-
else
53-
echo "Unknown event: ${{ github.event_name }}"
54-
exit 1
55-
fi
56-
57-
python3 scripts/set_assignees.py $FLAGS
31+
32+
- name: Check out source code
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
37+
with:
38+
python-version: 3.12
39+
40+
- name: cache-pip-linux
41+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
42+
with:
43+
path: ~/.cache/pip
44+
key: ${{ hashFiles('scripts/requirements-actions.txt') }}
45+
restore-keys: |
46+
${{ hashFiles('scripts/requirements-actions.txt') }}
47+
48+
- name: install-packages
49+
run: |
50+
pip install -r scripts/requirements-actions.txt
51+
52+
- name: Run assignment script
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
run: |
56+
FLAGS="-v"
57+
FLAGS+=" -o ${{ github.event.repository.owner.login }}"
58+
FLAGS+=" -r ${{ github.event.repository.name }}"
59+
FLAGS+=" -M MAINTAINERS.yml"
60+
if [ "${{ github.event_name }}" = "pull_request_target" ]; then
61+
FLAGS+=" -P ${{ github.event.pull_request.number }}"
62+
elif [ "${{ github.event_name }}" = "issues" ]; then
63+
FLAGS+=" -I ${{ github.event.issue.number }}"
64+
elif [ "${{ github.event_name }}" = "schedule" ]; then
65+
FLAGS+=" --modules"
66+
else
67+
echo "Unknown event: ${{ github.event_name }}"
68+
exit 1
69+
fi
70+
71+
python3 scripts/set_assignees.py $FLAGS

scripts/requirements-actions.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pygithub
2+
junitparser
3+
junit2html
4+
gcovr
5+
xlsxwriter
6+
ijson
7+
unidiff
8+
sh
9+
pytest
10+
pyyaml
11+
tox
12+
awscli
13+
elasticsearch
14+
west

0 commit comments

Comments
 (0)