1
1
name : Pull Request Assigner
2
2
3
3
on :
4
- pull_request_target :
4
+ pull_request :
5
5
types :
6
6
- opened
7
7
- synchronize
@@ -24,41 +24,68 @@ jobs:
24
24
if : github.event.pull_request.draft == false
25
25
runs-on : ubuntu-24.04
26
26
permissions :
27
- pull-requests : write # to add assignees to pull requests
28
27
issues : write # to add assignees to issues
29
28
30
29
steps :
31
- - name : Check out source code
32
- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
30
+ - name : Check out source code
31
+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32
+ with :
33
+ fetch-depth : 0
34
+ persist-credentials : false
33
35
34
- - name : Set up Python
35
- uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
36
- with :
37
- python-version : 3.12
38
- cache : pip
39
- cache-dependency-path : scripts/requirements-actions.txt
36
+ - name : Set up Python
37
+ uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
38
+ with :
39
+ python-version : 3.12
40
+ cache : pip
41
+ cache-dependency-path : scripts/requirements-actions.txt
40
42
41
- - name : Install Python packages
42
- run : |
43
- pip install -r scripts/requirements-actions.txt --require-hashes
43
+ - name : Install Python packages
44
+ run : |
45
+ pip install -r scripts/requirements-actions.txt --require-hashes
44
46
45
- - name : Run assignment script
46
- env :
47
- GITHUB_TOKEN : ${{ secrets.ZB_PR_ASSIGNER_GITHUB_TOKEN }}
48
- run : |
49
- FLAGS="-v"
50
- FLAGS+=" -o ${{ github.event.repository.owner.login }}"
51
- FLAGS+=" -r ${{ github.event.repository.name }}"
52
- FLAGS+=" -M MAINTAINERS.yml"
53
- if [ "${{ github.event_name }}" = "pull_request_target" ]; then
54
- FLAGS+=" -P ${{ github.event.pull_request.number }}"
55
- elif [ "${{ github.event_name }}" = "issues" ]; then
47
+ - name : west setup
48
+ if : >
49
+ github.event_name == 'pull_request'
50
+ run : |
51
+ git config --global user.email "[email protected] "
52
+ git config --global user.name "Your Name"
53
+ west init -l . || true
54
+ mkdir -p ./pr
55
+
56
+ - name : Run assignment script
57
+ env :
58
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
+ run : |
60
+ FLAGS="-v"
61
+ FLAGS+=" -o ${{ github.event.repository.owner.login }}"
62
+ FLAGS+=" -r ${{ github.event.repository.name }}"
63
+ FLAGS+=" -M MAINTAINERS.yml"
64
+ if [ "${{ github.event_name }}" = "pull_request" ]; then
65
+ FLAGS+=" -P ${{ github.event.pull_request.number }} --manifest -c origin/${{ github.base_ref }}.."
66
+ python3 scripts/set_assignees.py $FLAGS
67
+ cp -f manifest_areas.json ./pr/
68
+ elif [ "${{ github.event_name }}" = "issues" ]; then
56
69
FLAGS+=" -I ${{ github.event.issue.number }}"
57
- elif [ "${{ github.event_name }}" = "schedule" ]; then
70
+ python3 scripts/set_assignees.py $FLAGS
71
+ elif [ "${{ github.event_name }}" = "schedule" ]; then
58
72
FLAGS+=" --modules"
59
- else
60
- echo "Unknown event: ${{ github.event_name }}"
61
- exit 1
62
- fi
73
+ python3 scripts/set_assignees.py $FLAGS
74
+ else
75
+ echo "Unknown event: ${{ github.event_name }}"
76
+ exit 1
77
+ fi
78
+
79
+
80
+ - name : Save PR number
81
+ if : >
82
+ github.event_name == 'pull_request'
83
+ run : |
84
+ echo ${{ github.event.number }} > ./pr/NR
85
+ - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
86
+ if : >
87
+ github.event_name == 'pull_request'
88
+ with :
89
+ name : pr
90
+ path : pr/
63
91
64
- python3 scripts/set_assignees.py $FLAGS
0 commit comments